/* Animasjonen av appen på forsiden (brukes av index.html og demo.js). */
.demo-phone {
    position: relative;
    width: 270px;
    height: 560px;
    border-radius: 42px;
    overflow: hidden;
    background: var(--paper-shade);
    box-shadow: 0 24px 50px rgba(6, 74, 52, 0.25), 0 0 0 9px #12251d, 0 0 0 10px #2d3b34;
    font-size: 13px;
    color: var(--ink);
}

.screen { position: absolute; inset: 0; opacity: 0; transform: translateX(20px); transition: opacity .45s ease, transform .45s ease; }
.screen.active { opacity: 1; transform: none; }
.demo-phone.still .screen { transition: none; }

/* Som i appen: grønt rett ned, og den lyse bunnen legger seg over med runde hjørner, 12 px over det første kortet. */
.screen .top { background: var(--bottle); color: #fff; padding: 46px 18px 46px; position: relative; overflow: hidden; }
.screen .top::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: var(--paper-shade); border-radius: 22px 22px 0 0; z-index: 2; }
.screen .top::after { content: ""; position: absolute; right: -60px; top: -40px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.07); }
.screen .top > * { position: relative; z-index: 1; }
.screen .title { font-weight: 600; font-size: 21px; display: flex; align-items: baseline; gap: 8px; }
.screen .title span { color: var(--foam); font-size: 15px; }
.screen .title small { margin-left: auto; color: var(--foam); font-size: 12px; font-weight: 600; }
.screen .big { margin-top: 6px; }
.screen .big b { color: var(--cap); font-size: 38px; font-weight: 800; }
.screen .big span { color: var(--foam); font-size: 15px; }
.screen .figs { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.15); }
.screen .figs b { display: block; font-size: 15px; font-weight: 800; }
.screen .figs span { font-size: 10px; color: var(--foam); }
.screen .body { padding: 0 14px; margin-top: -18px; position: relative; z-index: 3; }
.screen .btn { background: var(--cap); border-radius: 999px; text-align: center; padding: 11px; font-weight: 600; font-size: 13px; box-shadow: 0 4px 10px rgba(6,74,52,.18); }
.screen .lbl { font-weight: 800; font-size: 13px; margin: 14px 4px 6px; }
.screen .card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.screen .row { display: grid; grid-template-columns: 1fr auto; }
.screen .row b { font-weight: 600; }
.screen .row span { grid-column: 1; font-size: 10.5px; color: var(--muted); }
.screen .row em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-weight: 600; font-size: 11px; background: var(--cap); padding: 3px 8px; border-radius: 999px; }

/* Hjem: kortene glir inn. */
.home.play .rise { animation: fadeUp .5s ease-out .35s both; }
.home.play .rise.d2 { animation-delay: .5s; }

/* Skann: lappen glir inn i rammen, strålen skanner, og «Alt funnet» kommer. */
.scan .cam { position: absolute; inset: 0 0 90px; background: linear-gradient(160deg, #3b4540, #1f2723); display: grid; place-items: center; }
.scan .slip { width: 130px; background: #fbfaf5; border-radius: 4px; padding: 12px 10px; text-align: center; font: 600 9px ui-monospace, Menlo, monospace; color: #222; box-shadow: 0 10px 20px rgba(0,0,0,.35); }
.scan .slip-bars, .till .bars { display: flex; gap: 1.5px; justify-content: center; height: 34px; margin: 8px 0; }
.scan .slip-bars i, .till .bars i { display: block; background: #111; }
.scan .frame { position: absolute; width: 170px; height: 210px; border: 3px solid var(--cap); border-radius: 18px; }
.scan .beam { position: absolute; width: 150px; height: 3px; background: var(--cap); box-shadow: 0 0 12px var(--cap); opacity: 0; }
.scan .panel { position: absolute; left: 10px; right: 10px; bottom: 14px; background: #fff; border-radius: 18px; padding: 16px; font-weight: 800; opacity: 0; }
.scan .ok { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bottle); color: #fff; font-size: 12px; margin-right: 6px; }
.scan.play .slip { animation: slipIn .8s ease-out both; }
.scan.play .beam { animation: beam 1.4s ease-in-out .8s both; }
.scan.play .panel { animation: fadeUp .4s ease-out 2.2s both; }

/* I kassen: grønt ark med hvit lapp og strekkode. */
.till { background: rgba(18,37,29,.55); }
.till .sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 70px; background: var(--bottle); border-radius: 26px 26px 0 0; padding: 22px 16px; }
.till .receipt { background: #fff; border-radius: 14px; padding: 14px; }
.till .store { font-weight: 600; }
.till .amount { font-size: 30px; font-weight: 800; color: var(--bottle); }
.till .bars { height: 60px; }
.till .code { text-align: center; font: 11px ui-monospace, Menlo, monospace; color: var(--muted); }
.till .hint { color: var(--foam); text-align: center; font-size: 11px; margin: 14px 8px; }
.till.play .sheet { animation: sheetUp .6s cubic-bezier(.2,.9,.3,1) both; }
.till.play .receipt { animation: glow 1.4s ease-in-out .7s both; }

/* Toppliste: den lyse bunnen er lav, og lista starter rett under. */
.board .top { padding-bottom: 28px; }
.board .top::before { height: 12px; }
.board .body { margin-top: 0; }

/* Poeng: Panti Shop med fordeler, med gul handlepose. */
.screen .soon { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-weight: 600; font-size: 11.5px; }
.screen .soon svg { width: 13px; height: 13px; flex: none; }

/* Toppliste: pallen vokser opp. */
.board .podium { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-top: 12px; }
.board .podium div { flex: 1; text-align: center; font-weight: 700; font-size: 11px; }
.board .podium i { display: grid; place-items: center; font-style: normal; font-weight: 800; color: var(--ink); border-radius: 10px 10px 3px 3px; transform-origin: bottom; }
.board .p1 { height: 74px; background: linear-gradient(#ffe27a, #e0a800); font-size: 20px; }
.board .p2 { height: 52px; background: linear-gradient(#eef1f4, #a9b2bc); }
.board .p3 { height: 38px; background: linear-gradient(#f0c29a, #b0703c); }
.board.play .podium i { animation: grow .7s cubic-bezier(.3,1.3,.5,1) both; }
.board.play .p2 { animation-delay: .15s; } .board.play .p1 { animation-delay: .3s; } .board.play .p3 { animation-delay: .45s; }
.board .lrow { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; }
.board .lrow i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 11px; }
.board .m1 { background: linear-gradient(135deg, #ffe27a, #e0a800); } .board .m2 { background: linear-gradient(135deg, #eef1f4, #a9b2bc); } .board .m3 { background: linear-gradient(135deg, #f0c29a, #b0703c); }
.board .lrow b { font-weight: 600; flex: 1; }
.board .lrow em { font-style: normal; font-weight: 700; font-size: 11px; }
.board .lrow.me { background: #ddf5e9; }

/* Poeng: myntene faller ned i kortet, og kortet fylles opp. */
.points .ccard { position: relative; aspect-ratio: 85.6 / 54; border-radius: 12px; padding: 14px; background: linear-gradient(135deg, #ffe27a, #ffc93c 50%, #e3a10f); overflow: hidden; box-shadow: 0 10px 20px rgba(6,74,52,.25); }
.points .ccard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,243,196,.6)); transform: scaleX(0); transform-origin: left; opacity: .6; }
.points .cname { font-weight: 800; letter-spacing: 3px; font-size: 14px; }
.points .chip { width: 28px; height: 20px; border-radius: 4px; background: linear-gradient(135deg, #e9e4d6, #b9b29c); margin-top: 6px; }
.points .cpts { display: flex; align-items: baseline; gap: 6px; margin-top: 18px; }
.points .cpts b { font: 800 28px ui-rounded, system-ui, sans-serif; }
.points .cowner { font: 600 9px ui-monospace, Menlo, monospace; letter-spacing: 1.5px; opacity: .75; margin-top: 2px; }
.points .pp { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.3px solid var(--ink); border-radius: 50%; font: 800 7px ui-rounded, system-ui, sans-serif; }
.points .coins { position: absolute; left: 0; right: 0; top: -190px; display: flex; justify-content: center; gap: 22px; pointer-events: none; }
.points .coins i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--cap); box-shadow: 0 2px 4px rgba(6,74,52,.3); }
.points .coins .pp { width: 26px; height: 26px; font-size: 9px; }
.points .card { margin-top: 12px; }
.points.play .coins i { animation: coin 1s ease-in both; }
.points.play .coins i:nth-child(2) { animation-delay: .15s; } .points.play .coins i:nth-child(3) { animation-delay: .3s; }
.points.play .ccard::after { animation: fill 1.2s ease-in-out 1.1s both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes capDrop { from { transform: translateY(-40px); opacity: 0; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes slipIn { from { transform: translateY(80px) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes beam { 0% { opacity: 0; transform: translateY(-70px); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(70px); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0); } 50% { box-shadow: 0 0 28px rgba(255,255,255,.8); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes coin { from { transform: translateY(0); opacity: 1; } 85% { opacity: 1; } to { transform: translateY(300px); opacity: 0; } }
@keyframes fill { 0% { transform: scaleX(0); opacity: .6; } 70% { transform: scaleX(1); opacity: .6; } 100% { transform: scaleX(1); opacity: 0; } }
