/* Fælles stil for Livias Legehus. Hvert rum lægger sin egen stil i sin js-fil. */
:root { --bg: #FFF6EC; --kontur: #4A3B5C; --skygge: 0 8px 0 rgba(74,59,92,.15);
  --koekken: #FFB38A; --garderobe: #F7A8D0; --tegning: #8FD3F4; --klodser: #A8E6A1; --dyr: #FFE07A; --puslespil: #C9B8F0; --bad: #9EE3E0; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-text-size-adjust: 100%; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; background: var(--bg); }
svg, img { display: block; }
img { -webkit-user-drag: none; user-select: none; }
button { font: inherit; padding: 0; border: 0; background: none; cursor: pointer; touch-action: none; }
[hidden] { display: none !important; }

/* Forside */
#forside { background: url(billeder/bg/forside.jpg) center/cover; position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2vh; box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.overskrift img { height: min(20vh, 200px); width: auto; animation: vink 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
#fliser { display: grid; grid-template-columns: repeat(2, auto); gap: 16px; }
.flis { width: min(40vw, 16vh); aspect-ratio: 1; border-radius: 32px; border: 4px solid var(--kontur);
  box-shadow: var(--skygge); display: grid; place-items: center; }
.flis img { width: 78%; height: 78%; object-fit: contain; pointer-events: none; }
.flis.koekken { background: var(--koekken); } .flis.garderobe { background: var(--garderobe); }
.flis.tegning { background: var(--tegning); } .flis.klodser { background: var(--klodser); }
.flis.dyr { background: var(--dyr); } .flis.puslespil { background: var(--puslespil); } .flis.bad { background: var(--bad); }
@media (orientation: landscape) {
  #fliser { grid-template-columns: repeat(4, auto); }
  .flis { width: min(20vw, 30vh); }
}

/* Rum: fylder skærmen, zoomer ind fra knappen */
.rum { position: fixed; inset: 0; overflow: hidden; background: var(--bg); animation: ind .3s ease-out; }
.rum { background-position: center; background-size: cover; }
.rum[data-rum="koekken"] { background-image: url(billeder/bg/koekken.jpg); } .rum[data-rum="garderobe"] { background-image: url(billeder/bg/garderobe.jpg); }
.rum[data-rum="tegning"] { background-image: url(billeder/bg/tegning.jpg); } .rum[data-rum="klodser"] { background-image: url(billeder/bg/klodser.jpg); }
.rum[data-rum="dyr"] { background-image: url(billeder/bg/dyr.jpg); background-position: 30% center; }
.rum[data-rum="puslespil"] { background-image: url(billeder/bg/puslespil.jpg); } .rum[data-rum="bad"] { background-image: url(billeder/bg/bad.jpg); }
.hjem { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 50; width: 88px; height: 88px; border-radius: 50%;
  background: #fff; border: 4px solid var(--kontur); box-shadow: var(--skygge); display: grid; place-items: center; }
.hjem img { width: 60px; height: 60px; object-fit: contain; pointer-events: none; }

/* Feedback */
.hop { animation: hop .2s ease-out; }
@keyframes hop { 40% { transform: scale(1.15); } }
@keyframes ind { from { transform: scale(.4); opacity: 0; } }
@keyframes vink { 50% { transform: rotate(-3deg); } }

/* Hjælpehånd */
.hjaelpehaand { position: absolute; z-index: 60; width: 84px; height: 84px; pointer-events: none;
  transition: left .8s ease-in-out, top .8s ease-in-out; }
.hjaelpehaand.trykker svg { animation: tryk .6s ease-in-out 2; }
@keyframes tryk { 50% { transform: translate(-6px, -10px) scale(.88); } }

/* Livia */
.kanin { position: relative; touch-action: none; }
.kanin svg { width: 100%; height: 100%; overflow: visible; }
.kanin .oejne { opacity: 0; }
.kanin.blink .oejne { opacity: 1; }
.kanin.tygger > svg { animation: tyg .25s ease-in-out 4; transform-origin: 50% 100%; }
.kanin.glad > svg { animation: gladhop .5s ease-out 2; }
@keyframes tyg { 50% { transform: scale(1.05, .94); } }
@keyframes gladhop { 40% { transform: translateY(-8%) rotate(-4deg); } 70% { transform: translateY(0) rotate(3deg); } }

/* Udfordringer */
.ryst { animation: ryst .4s ease-in-out; }
@keyframes ryst { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.fest { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.fest i, .fest b { position: absolute; left: 50%; top: 50%; width: 9vmin; margin: -4.5vmin; animation: stjerneud 1.4s ease-out forwards; }
.fest b { width: 30vmin; margin: -15vmin; animation: stjernestor 1.4s ease-out forwards; }
@keyframes stjerneud { from { transform: scale(.2); opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(200deg) scale(1); opacity: 0; } }
@keyframes stjernestor { 0% { transform: scale(0) rotate(-30deg); } 30% { transform: scale(1.15) rotate(8deg); } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.oenske { position: absolute; z-index: 20; display: flex; gap: 8px; align-items: center; padding: 14px 18px; background: #fff;
  border: 4px solid var(--kontur); border-radius: 40px; box-shadow: var(--skygge); pointer-events: none; animation: ind .3s ease-out; }
.oenske::after { content: ''; position: absolute; left: 22%; bottom: -26px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 4px solid var(--kontur); }
.oenske img { width: 64px; height: 64px; object-fit: contain; }
.flis { position: relative; }
.flis-stjerner { position: absolute; left: 0; right: 0; bottom: -14px; display: flex; justify-content: center; pointer-events: none; }
.flis-stjerner svg { width: 24px; height: 24px; margin: 0 -2px; }
