/* „Der Umzug – Das Spiel" — Design System */

@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/Baloo2.ttf') format('truetype');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --cream: #FAF3E7;
  --ink: #3E3128;
  --coral: #E8604C;
  --coral-dark: #C74A38;
  --teal: #2F8F83;
  --yellow: #F2B84B;
  --ceiling: #FDFBF7;
  --wall: #F6F1E8;
  --gray-paint: #CDCAC3;
  --wood: #C89B6D;
  --dark: #2B2119;
  --font-hand: 'Baloo 2', 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #3A2D22 0%, var(--dark) 70%);
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}

/* ---------- Stage (logical 960×600, scaled by main.js) ---------- */

#stage-wrap {
  position: fixed;
  left: 50%; top: 50%;
  width: 960px; height: 600px;
  transform-origin: center center;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 6px rgba(255,255,255,.04);
  background: var(--cream);
  overflow: hidden;
}

#shaker { position: absolute; inset: 0; }

#stage {
  position: absolute; inset: 0;
  overflow: hidden;
}

#stage canvas { position: absolute; left: 0; top: 0; }

#fx {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 40;
}

#ui {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 50;
}

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none;
  z-index: 60;
}

.hud-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(62, 49, 40, .82);
  color: #F6EDDD;
  font-size: 13px; font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  opacity: .45;
  transition: opacity .3s, transform .3s;
}
.hud-chip.active { opacity: 1; transform: scale(1.07); background: var(--coral); }
.hud-chip.done { opacity: .9; background: var(--teal); }

#mute-btn {
  margin-left: auto;
  pointer-events: auto;
  cursor: pointer;
  border: none;
  background: rgba(62, 49, 40, .82);
  color: #fff;
  font-size: 15px;
  width: 34px; height: 34px;
  border-radius: 50%;
  transition: transform .15s;
}
#mute-btn:hover { transform: scale(1.12); }

/* ---------- Cards (intro / outro / title) ---------- */

.card-veil {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43, 33, 25, .45);
  backdrop-filter: blur(2px);
  pointer-events: auto;
  opacity: 0;
  transition: opacity .35s;
}
.card-veil.show { opacity: 1; }
.card-veil.leaving { opacity: 0; }

.card {
  width: min(560px, 88%);
  background: var(--cream);
  border-radius: 22px;
  padding: 34px 40px 30px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.4), inset 0 0 0 3px rgba(232,96,76,.15);
  transform: scale(.85) translateY(14px);
  transition: transform .4s cubic-bezier(.2, 1.6, .4, 1);
}
.card-veil.show .card { transform: scale(1) translateY(0); }

.card .kicker {
  font-size: 12px; font-weight: 800;
  letter-spacing: .22em;
  color: var(--coral);
  margin-bottom: 10px;
}
.card h1 {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.25;
  margin-bottom: 14px;
}
.card h1.big { font-size: 36px; }
.card p {
  font-size: 15.5px;
  line-height: 1.55;
  color: #5C4C3F;
  margin-bottom: 10px;
}
.card .hint {
  font-size: 13px;
  color: #8A7A6B;
  background: rgba(47, 143, 131, .1);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 14px 0 4px;
}

.btn {
  display: inline-block;
  margin-top: 16px;
  border: none;
  cursor: pointer;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 19px;
  padding: 12px 34px;
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--coral-dark), 0 10px 20px rgba(232,96,76,.35);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--coral-dark); }
.btn.subtle {
  background: transparent;
  color: #C8B9A8;
  font-size: 14px;
  box-shadow: none;
  border: 2px solid rgba(200,185,168,.4);
  padding: 8px 20px;
}

/* ---------- Toasts ---------- */

#toasts {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
  z-index: 70;
}

.toast {
  max-width: 66%;
  background: rgba(62, 49, 40, .88);
  color: #FFF6E8;
  font-size: 14px; font-weight: 600;
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  animation: toastIn .35s cubic-bezier(.2, 1.5, .4, 1);
  transition: opacity .4s, transform .4s;
}
.toast.bad { background: rgba(232, 96, 76, .92); }
.toast.good { background: rgba(47, 143, 131, .92); }
.toast.gone { opacity: 0; transform: translateY(10px); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(.9); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Title screen decorations ---------- */

.float-emoji {
  position: absolute;
  font-size: 34px;
  opacity: .5;
  animation: floaty 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-16px) rotate(6deg); }
}

/* ---------- Finale headline (used by finale.js) ---------- */

.finale-headline {
  position: absolute;
  left: 0; right: 0; top: 12%;
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 800;
  font-size: 52px;
  color: #FFF3D6;
  text-shadow: 0 4px 0 rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.4);
  animation: headlinePop .7s cubic-bezier(.2, 1.6, .4, 1);
  pointer-events: none;
}
.finale-line {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 24px;
  color: #FFE9B8;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  opacity: 0;
  animation: lineIn 1s ease forwards;
  pointer-events: none;
}
@keyframes headlinePop {
  from { opacity: 0; transform: scale(.5) translateY(30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lineIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- In-level status line (levels may use) ---------- */

.level-status {
  position: absolute;
  top: 52px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
  pointer-events: none;
  z-index: 30;
}
