/* App-lag (kun Capacitor-appen). Alt her er scopet til html.is-app, så hjemmesiden er uændret.
   Brand/farver kommer fra temaet (--bg, --pink, --card-solid ...). Her ligger kun layout, navigation og berøring. */
html.is-app {
  --app-safe-top: var(--safe-top); --app-safe-bottom: var(--safe-bottom);
  --app-header-height: calc(56px + var(--safe-top)); --app-bottom-nav-height: calc(64px + var(--safe-bottom));
  --app-touch-target: 44px; --app-radius: 16px;
  --app-spacing-xs: 4px; --app-spacing-sm: 8px; --app-spacing-md: 16px; --app-spacing-lg: 24px;
  --app-transition-fast: .12s; --app-transition-normal: .25s;
  --app-surface: var(--card-solid); --app-surface-elevated: color-mix(in srgb, var(--card-solid) 90%, #fff);
}
.app-only { display: none; } html.is-app .app-only { display: block; }

/* Shell: ingen footer, og brødkrumme bliver til "‹ Forælder" */
html.is-app .footer { display: none !important; }
html.is-app .crumbs { margin: 0 0 var(--app-spacing-sm); }
html.is-app .crumbs > :not(a:last-of-type) { display: none !important; }
html.is-app .crumbs a:last-of-type { display: inline-flex; align-items: center; min-height: var(--app-touch-target); font-weight: 700; text-decoration: none; }
html.is-app .crumbs a:last-of-type::before { content: "‹"; font-size: 1.6em; line-height: 1; margin-right: 6px; }

/* Berøring: ingen blå markering/tekstvalg/lang-tryk-menu på kontroller (ikke på almindelig tekst, chat eller koder) */
html.is-app :is(.btn, .chip, .tab, .bnav a, .iconbtn, .bellbtn, .an-burger, .an-x, button, summary, .gcard, .app-sheet) { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
html.is-app :is(.btn, .chip, .tab, .bnav a, .iconbtn, .bellbtn, .gcard) { transition: transform var(--app-transition-fast) ease-out, opacity var(--app-transition-fast); }
html.is-app :is(.btn, .chip, .tab, .bnav a, .iconbtn, .bellbtn, .gcard):active { transform: scale(.97); }
html.is-app :is(.chip, .tab, .iconbtn, .bellbtn) { min-width: var(--app-touch-target); min-height: var(--app-touch-target); }

/* Reducér animationer (indstilling i appen) */
html.app-reduce *, html.app-reduce *::before, html.app-reduce *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

/* Bundark til bekræftelser (i stedet for browserens confirm) */
.app-sheet-bg { position: fixed; inset: 0; z-index: var(--z-modal, 300); display: flex; align-items: flex-end; justify-content: center; background: rgba(4,2,8,.62); opacity: 0; transition: opacity .2s; }
.app-sheet-bg.on { opacity: 1; }
.app-sheet { width: min(520px, 100%); box-sizing: border-box; padding: 20px max(16px, var(--safe-right)) calc(16px + var(--safe-bottom)) max(16px, var(--safe-left)); background: var(--card-solid); border: 1px solid var(--line-hot, rgba(255,255,255,.14)); border-bottom: 0; border-radius: 24px 24px 0 0; display: grid; gap: 10px; transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.3,1); }
.app-sheet-bg.on .app-sheet { transform: none; }
.app-sheet p { margin: 0 0 6px; font-size: 18px; font-weight: 700; text-align: center; text-wrap: balance; }
.app-sheet .btn { width: 100%; min-height: 50px; justify-content: center; }

/* Aktiv fest: lille svævende genvej over bundmenuen */
.app-party { position: fixed; z-index: var(--z-sticky, 40); right: max(14px, var(--safe-right)); bottom: calc(var(--app-bottom-nav-height) + 10px); display: none; align-items: center; gap: 8px; min-height: var(--app-touch-target); padding: 0 16px; border-radius: 99px; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; font-weight: 800; text-decoration: none; box-shadow: 0 10px 30px -8px rgba(0,0,0,.6); }
html.is-app .app-party { display: inline-flex; } html.is-app.game-mode .app-party { display: none; }

/* Festkode: stor, tydelig og kan trykkes for at kopiere */
html.is-app #codeBox { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .24em; font-size: clamp(34px, 11vw, 52px); cursor: pointer; -webkit-user-select: none; user-select: none; }

/* Chat-input: vokser, og send er dæmpet, når feltet er tomt */
html.is-app .chat-row textarea { resize: none; max-height: 132px; }
html.is-app .chat-row .btn.app-empty { opacity: .45; }

/* Spil: kategorier som vandret karrusel, søgefelt og kategorier klistrer under headeren */
html.is-app #filters { display: contents; }
html.is-app #filters > .search { position: sticky; top: var(--app-nav-h, 64px); z-index: var(--z-sticky, 40); margin: 0; padding: 8px 0; background: var(--bg); }
html.is-app #filters > .chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 0 8px; padding: 2px 0; }
html.is-app #filters > .chips::-webkit-scrollbar { display: none; }
html.is-app #filters > .chips > * { flex: none; white-space: nowrap; scroll-snap-align: start; }
html.is-app #filters > #catChips { position: sticky; top: calc(var(--app-nav-h, 64px) + var(--app-search-h, 56px)); z-index: var(--z-sticky, 40); padding: 6px 0; background: var(--bg); }
html.is-app #filters > .row-filters { margin: 6px 0 16px; }
/* Seneste søgninger */
.sr-g h3 { display: flex; justify-content: space-between; align-items: center; }
.sr-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 8px; min-height: 44px; }
/* Spil-preview (bundark) */
.app-prev { max-height: 88dvh; overflow-y: auto; }
.app-prev .art { position: relative; border-radius: var(--app-radius, 16px); overflow: hidden; }
.app-prev h3 { margin: 4px 0 0; font-size: 22px; text-align: center; }
.app-prev .meta, .app-prev .facts, .app-prev .gtags { margin: 0; text-align: center; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.app-prev .btn.big { min-height: 56px; font-size: 18px; }
.app-sheet-bg.on .app-prev .art { animation: appCover .4s cubic-bezier(.2,.8,.3,1); }
@keyframes appCover { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
/* Headeren skal sidde fast i appen. Halvfuld-temaet sætter .nav til position:relative, og body som scroll-container bryder sticky */
html.is-app body { overflow-x: clip; }
html.is-app header.nav { position: sticky; top: 0; }
html.is-app #filters > .search { display: block; }

/* Notifikationer som bannere øverst. Under et aktivt spil vises nyheds-bannere ikke (de ligger stadig i indbakken og badge) */
html.is-app .toasts { top: calc(var(--safe-top) + 8px); bottom: auto; }
html.is-app .toasts .toast { animation: appBanner .3s cubic-bezier(.2,.8,.3,1); }
html.is-app.game-mode .toast.news { display: none; }
@keyframes appBanner { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
.bnav a { position: relative; } .bn-dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: #FF4D6D; box-shadow: 0 0 0 2px var(--bg); }
.nt-grp { margin: 14px 4px 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.nt-item { position: relative; } .nt-read { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 18px; }
.set-list { display: grid; gap: 10px; } .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }

/* ===== App-hjem ===== */
.app-home { display: none; }
html.is-app .app-home { display: grid; gap: 12px; padding: 16px max(16px, var(--safe-left)) 4px max(16px, var(--safe-right)); }
.ah-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--app-radius, 16px); background: var(--card-solid); border: 1px solid var(--line-hot, rgba(255,255,255,.14)); color: var(--ink); text-decoration: none; }
.ah-ic { font-size: 32px; line-height: 1; } .ah-t { flex: 1; min-width: 0; display: grid; } .ah-t small { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); } .ah-t b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-party { background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 28%, var(--card-solid)), var(--card-solid)); }
.ah-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ah-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: var(--app-radius, 16px); background: var(--card-solid); border: 1px solid var(--line); color: var(--ink); font-weight: 800; text-decoration: none; }
.ah-friends h2 { margin: 6px 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ah-fl { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; } .ah-fl::-webkit-scrollbar { display: none; }
.ah-f { flex: none; width: 56px; display: grid; justify-items: center; gap: 4px; text-decoration: none; color: var(--ink); position: relative; }
.ah-f .av, .ah-f .avatar { width: 48px; height: 48px; } .ah-f small { max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ah-f::before { content: ""; position: absolute; top: -3px; left: 50%; width: 54px; height: 54px; margin-left: -27px; border-radius: 50%; border: 2px solid #3DDC84; pointer-events: none; }
/* Daglige quests på app-hjem: kun de to vigtigste */
html.is-app .sec-quests .qs-panel:not(.qs-daily) { display: none; }
html.is-app .sec-quests .qs-daily .qc:nth-child(n+3) { display: none; }
html.is-app .qc-bar i { animation: qGrow .9s cubic-bezier(.2,.8,.3,1); } @keyframes qGrow { from { width: 0; } }
/* Mini XP-bar i headeren (kun på Hjem, Spil og Profil) og XP-ring om profilbilledet */
.app-xpbar { display: none; }
html.is-app body:is(.page-home, .page-games, .page-profile) .app-xpbar { display: block; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--xp, 0) * 1%); background: linear-gradient(90deg, var(--pink), var(--purple)); border-radius: 0 3px 3px 0; transition: width .8s cubic-bezier(.2,.8,.3,1); }
html.is-app header.nav::after { display: none; }
html.is-app .pf-av { position: relative; padding: 5px; border-radius: 50%; background: conic-gradient(var(--pink) calc(var(--xp, 0) * 1%), rgba(255,255,255,.12) 0); }
html.is-app .pf-av > * { border-radius: 50%; }
/* XP der flyder op, og Level up */
.app-xpfloat { position: fixed; z-index: var(--z-toast, 400); left: 50%; bottom: calc(var(--app-bottom-nav-height, 70px) + 24px); transform: translateX(-50%); font-family: var(--f-hero, inherit); font-weight: 900; font-size: 26px; color: #FFD84D; text-shadow: 0 2px 14px rgba(0,0,0,.7); pointer-events: none; animation: xpUp 1.6s ease-out forwards; }
@keyframes xpUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }
.app-levelup { position: fixed; inset: 0; z-index: var(--z-modal, 300); display: grid; place-items: center; text-align: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--pink) 40%, #000), #05030A 70%); opacity: 0; transition: opacity .3s; padding: max(24px, var(--safe-top)) 24px max(24px, var(--safe-bottom)); }
.app-levelup.on { opacity: 1; } .app-levelup h2 { margin: 0; font-family: var(--f-hero, inherit); font-size: clamp(40px, 14vw, 72px); letter-spacing: .04em; animation: lvPop .7s cubic-bezier(.2,1.4,.4,1); } .app-levelup p { font-size: 22px; font-weight: 800; margin: 10px 0 24px; } .app-levelup .lv-ic { font-size: 84px; animation: lvPop .8s .1s both cubic-bezier(.2,1.4,.4,1); }
@keyframes lvPop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Fest-rum ===== */
.app-room { display: grid; gap: 12px; margin: 14px 0; padding: 14px; border-radius: var(--app-radius, 16px); background: var(--card-solid); border: 1px solid var(--line); }
.app-room[hidden] { display: none; }
.ar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .ar-top b { font-size: 16px; } .ar-top small { color: var(--muted); }
.ar-pl { display: flex; flex-wrap: wrap; gap: 14px 12px; justify-content: center; }
.ar-p { position: relative; width: 68px; display: grid; justify-items: center; gap: 4px; font-size: 12px; text-align: center; }
.ar-a { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 20px; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; border: 2px solid transparent; }
.ar-a { overflow: hidden; position: relative; } .ar-a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 50%; }
.ar-p.ready .ar-a { border-color: #3DDC84; } .ar-p.off .ar-a { opacity: .45; }
.ar-p b { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-crown { position: absolute; top: -12px; font-style: normal; font-size: 18px; } .ar-ok { position: absolute; top: 34px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #3DDC84; color: #04210F; font-style: normal; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.ar-p.join-in { animation: arJoin .5s cubic-bezier(.2,1.4,.4,1); } @keyframes arJoin { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.ar-p .ar-crown.move { animation: arCrown .8s cubic-bezier(.2,1.4,.4,1); } @keyframes arCrown { from { transform: translateY(-30px) scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ar-act { display: flex; flex-wrap: wrap; gap: 8px; } .ar-act .btn { flex: 1 1 140px; min-height: 48px; justify-content: center; }
.ar-q { display: grid; gap: 8px; } .ar-q h3 { margin: 0; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.ar-qi { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink); font: inherit; font-weight: 700; text-align: left; width: 100%; }
.ar-qi.on { border-color: var(--pink); } .ar-qi span:nth-child(2) { flex: 1; } .ar-qi i { font-style: normal; color: var(--muted); }
.ar-edit { display: grid; gap: 8px; } .ar-edit input { width: 100%; box-sizing: border-box; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); padding: 0 12px; font-size: 16px; }
.ar-res { display: grid; gap: 6px; }
.app-ov { position: fixed; inset: 0; z-index: var(--z-modal, 300); display: grid; place-items: center; text-align: center; background: rgba(5,3,10,.88); padding: 24px; }
.app-ov h2 { margin: 0; font-size: 28px; } .app-ov .btn { margin-top: 18px; min-width: 200px; min-height: 56px; justify-content: center; }
.app-cd { font-family: var(--f-hero, inherit); font-size: clamp(90px, 38vw, 180px); font-weight: 900; line-height: 1; animation: lvPop .5s cubic-bezier(.2,1.4,.4,1); }
.app-next { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--app-radius, 16px); background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 30%, var(--card-solid)), var(--card-solid)); border: 1px solid var(--pink); }
.app-next > span:first-child { flex: 1; font-weight: 800; }
/* Spil-toolbar i appen */
html.is-app .play-bar { position: sticky; top: 0; z-index: var(--z-header, 60); display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-top) + 6px) max(8px, var(--safe-right)) 6px max(8px, var(--safe-left)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html.is-app .play-bar .back { display: inline-flex; align-items: center; min-height: var(--app-touch-target); min-width: var(--app-touch-target); font-weight: 800; text-decoration: none; }
html.is-app .play-bar .gm-title { position: absolute; left: 50%; transform: translateX(-50%); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; pointer-events: none; }
html.is-app .play-bar .play-tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
html.is-app .play-bar .play-tools .iconbtn { width: var(--app-touch-target); height: var(--app-touch-target); }
html.is-app.game-mode main:has(.play-bar) { padding-top: 0; }

/* ===== Chat i appen ===== */
html.is-app .cm small { display: none; } html.is-app .cm.show-t small { display: block; }
.cm-sep { align-self: center; margin: 10px 0 4px; padding: 3px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); background: rgba(255,255,255,.06); }
.cm-sep.new { color: var(--pink); background: color-mix(in srgb, var(--pink) 16%, transparent); }
.cm-state { align-self: flex-end; margin: -4px 6px 0; font-size: 11px; color: var(--muted); }
.cm-fab { position: fixed; z-index: var(--z-sticky, 40); right: max(14px, var(--safe-right)); bottom: calc(86px + var(--safe-bottom)); min-width: 44px; height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-hot, rgba(255,255,255,.2)); background: var(--card-solid); color: var(--ink); font-weight: 800; box-shadow: 0 8px 24px -8px #000; }
html.is-app.kb-open .cm-fab { bottom: 76px; }
.cm-view img { max-width: 100%; max-height: 80dvh; border-radius: 12px; } .cm-view img.zoom { border-radius: 50%; width: min(80vw, 320px); height: min(80vw, 320px); object-fit: cover; animation: lvPop .3s cubic-bezier(.2,1.4,.4,1); }
/* ===== Profil ===== */
html.is-app .pf-hero { position: relative; overflow: hidden; } html.is-app .pf-top { transform: translateY(var(--py, 0px)); will-change: transform; }
html.is-app .pf-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 96px; background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 55%, transparent), color-mix(in srgb, var(--purple) 50%, transparent)); opacity: .55; pointer-events: none; }
.pf-more { position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: #fff; font-size: 18px; font-weight: 900; letter-spacing: 1px; }
html.is-app .pf-chips { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; scrollbar-width: none; } html.is-app .pf-chips::-webkit-scrollbar { display: none; }
html.is-app .pf-chips > * { flex: 0 0 62%; scroll-snap-align: start; }
.rh { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; } .rh li { display: flex; align-items: center; gap: 10px; } .rh b { flex: 1; } .rh small { color: var(--muted); }
html.is-app .f-av:has(.on-dot) .av, html.is-app .f-av:has(.on-dot) .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #3DDC84; }
.app-back { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 4px; } .app-back a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 800; text-decoration: none; color: var(--ink); } .app-back b { flex: 1; text-align: center; margin-right: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Achievements som samling: tre fliser pr. række */
html.is-app :has(> .ax-card) { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
html.is-app .ax-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 6px; gap: 6px; min-width: 0; }
html.is-app .ax-card .ax-ic { font-size: 30px; } html.is-app .ax-card .ax-t { font-size: 12px; line-height: 1.2; overflow-wrap: anywhere; }
html.is-app .ax-card .ax-d, html.is-app .ax-card .ax-lock, html.is-app .ax-card .ax-st, html.is-app .ax-card .ax-bar, html.is-app .ax-card .ax-xp { display: none; }
html.is-app .ax-card.open { grid-column: 1 / -1; } html.is-app .ax-card.open :is(.ax-d, .ax-lock, .ax-st, .ax-bar, .ax-xp) { display: block; }
html.is-app .ax-top { justify-content: center; } .ax-pu { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.qs-all { margin-top: 10px; width: 100%; justify-content: center; min-height: 48px; }

/* Cover-overgang fra spilkort til spilside (view transition, kun i appen) */
html.is-app.vt-on .game-hero .art.big { view-transition-name: game-cover; }
::view-transition-old(game-cover), ::view-transition-new(game-cover) { height: 100%; object-fit: cover; }
/* Venneaktivitet */
.ah-act h2 { margin: 6px 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ah-act ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ah-act a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--card-solid); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ah-act a > span:first-child { font-size: 24px; } .ah-act small { display: block; color: var(--muted); font-size: 12px; }
html:not(.is-app) .ah-act { display: none; }
/* Svar i chat */
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 6px 10px; border-left: 3px solid var(--pink); border-radius: 8px; background: rgba(255,255,255,.06); font-size: 13px; }
.reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .reply-bar button { width: 36px; height: 36px; border: 0; background: none; color: var(--ink); font-size: 16px; }
.cm-quote { display: grid; margin: 0 0 4px; padding: 4px 8px; border-left: 3px solid var(--pink); border-radius: 6px; background: rgba(0,0,0,.2); font-size: 12px; opacity: .9; } .cm-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.cm-reply { margin-top: 4px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--ink); font-size: 12px; font-weight: 700; }
.cm.flash { animation: cmFlash 1s; } @keyframes cmFlash { 0%, 60% { background: color-mix(in srgb, var(--pink) 35%, transparent); } }
/* Nyheder som indbakke */
html.is-app .nw-list { display: grid; gap: 0; border-radius: var(--app-radius, 16px); overflow: hidden; border: 1px solid var(--line); background: var(--card-solid); }
html.is-app .nw-card { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; padding: 12px 14px; background: transparent; }
html.is-app .nw-card:last-child { border-bottom: 0; } html.is-app .nw-card .nw-x { display: none; } html.is-app .nw-card.is-new .nw-t b { color: var(--ink); }
/* Tomme tilstande og spilkø */
html.is-app .gal-none { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; border-radius: var(--app-radius, 16px); background: var(--card-solid); border: 1px dashed var(--line); }
html.is-app .gal-emo { font-size: 44px; }
.ar-qi { animation: arIn .3s ease-out; } @keyframes arIn { from { opacity: 0; transform: translateY(6px); } }
.ar-qi.bump { animation: arBump .3s; } @keyframes arBump { 50% { transform: scale(1.03); } }
html.is-app .play-bar .play-tools > .btn { display: none; }
.pb-more { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); font-size: 18px; font-weight: 900; }
html.is-app.vt-on .bnav { view-transition-name: bnav; } html.is-app.vt-on header.nav { view-transition-name: hdr; }

/* ===== Ydelse i appen: færre dyre effekter, så sideskift ikke hakker =====
   Slørede, animerede flader, backdrop-filter og en canvas der tegner hele tiden koster GPU ved hvert nyt dokument i WKWebView. */
html.is-app .blob { filter: none; animation: none; will-change: auto; background: radial-gradient(circle closest-side, var(--c, var(--pink)), transparent 70%); }
html.is-app .b1 { --c: var(--pink); } html.is-app .b2 { --c: var(--purple); } html.is-app .b3 { --c: var(--blue); }
html.is-app .grain, html.is-app .lights { display: none; }
html.is-app :is(.nav, .bnav, .modal-bg, .invite-pop, .qh-bg, .play-bar, .an-top, .bare-card, .search-gate, .app-sheet-bg, .qr-modal, .push-ask) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.is-app header.nav { background: rgba(9, 8, 26, .97); }
html.is-app .bnav { background: rgba(10, 6, 22, .98); }
html.is-app .play-bar { background: var(--bg); }

/* Blød sideovergang: et fast lag i baggrundsfarven toner ind på den gamle side og ud på den nye. Kun opacitet, så siden ikke tegnes om */
html.is-app.leaving::after, html.is-app.veil-in::after { content: ""; position: fixed; inset: 0; z-index: 10050; background: var(--bg); pointer-events: none; }
html.is-app.leaving::after { animation: veilIn .16s ease-in forwards; }
html.is-app.veil-in::after { animation: veilOut .26s ease-out forwards; }
@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } } @keyframes veilOut { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html.is-app.leaving::after, html.is-app.veil-in::after { animation-duration: .01s; } }
html.is-app.app-reduce.leaving::after, html.is-app.app-reduce.veil-in::after { animation-duration: .01s; }

/* ===== Installérbar web-app (PWA) ===== */
.pwa-cta[hidden] { display: none !important; }
html.is-pwa .pwa-cta { display: none !important; }
/* Med black-translucent ligger indholdet under statusbaren: sider uden header skal selv holde afstand */
html.is-app .bare-wrap { padding-top: max(24px, calc(var(--safe-top) + 12px)); padding-bottom: max(24px, calc(var(--safe-bottom) + 12px)); }
.pwa-page .pwa-done { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; } .pwa-big { font-size: 44px; }
.pwa-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.pwa-step { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--card-solid); border: 1px solid var(--line); animation: pwaGlow 9s infinite; }
.pwa-step.s2 { animation-delay: 3s; } .pwa-step.s3 { animation-delay: 6s; }
.pwa-n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.pwa-t { flex: 1; min-width: 0; display: grid; gap: 2px; } .pwa-t small { color: var(--muted); }
.pwa-ic { flex: none; width: 48px; height: 48px; color: var(--pink); }
.pwa-step.s1 .pwa-ic { animation: pwaBob 1.6s ease-in-out infinite; }
@keyframes pwaGlow { 0%, 28% { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 28%, transparent); transform: scale(1.015); } 34%, 100% { border-color: var(--line); box-shadow: none; transform: none; } }
@keyframes pwaBob { 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .pwa-step, .pwa-step.s1 .pwa-ic { animation: none; } }
.pwa-foot { margin-top: 18px; }
.pwa-cta-row { margin: 14px 0 0; }
.pwa-inapp { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 26px 18px; border-color: var(--pink); } .pwa-inapp h2 { margin: 0; font-size: 26px; text-wrap: balance; } .pwa-inapp p { margin: 0; color: var(--muted); }
.pwa-inapp-how { color: var(--ink) !important; } .pwa-dots { display: inline-block; padding: 0 8px; border-radius: 99px; background: rgba(255,255,255,.12); letter-spacing: 2px; }
/* Pile: nederst mod Safaris Del-knap (iPhone), øverst til højre mod menuen i andre apps */
.pwa-arrow-bottom { position: fixed; z-index: 60; left: 50%; bottom: calc(76px + var(--safe-bottom)); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; padding: 8px 16px; border-radius: 16px; background: var(--card-solid); border: 1px solid var(--pink); color: var(--pink); font-weight: 800; box-shadow: 0 10px 30px -8px rgba(0,0,0,.7); animation: pwaPoint 1.3s ease-in-out infinite; pointer-events: none; }
.pwa-arrow-bottom span { color: var(--ink); font-size: 14px; } .pwa-arrow-bottom svg { width: 34px; height: 34px; }
.pwa-arrow-bottom.pwa-arrow-ipad { bottom: auto; top: calc(10px + var(--safe-top)); right: 14px; left: auto; transform: none; }
.pwa-arrow-bottom.pwa-arrow-ipad svg { transform: rotate(180deg); }
.pwa-arrow-top { position: fixed; z-index: 95; top: calc(8px + var(--safe-top)); right: 14px; display: grid; justify-items: end; gap: 0; color: var(--pink); font-weight: 800; animation: pwaPointUp 1.3s ease-in-out infinite; pointer-events: none; }
.pwa-arrow-top svg { width: 64px; height: 64px; } .pwa-arrow-top span { color: var(--ink); font-size: 14px; margin-right: 6px; }
@keyframes pwaPoint { 50% { transform: translateX(-50%) translateY(8px); } } .pwa-arrow-bottom.pwa-arrow-ipad { animation-name: pwaPointUp; }
@keyframes pwaPointUp { 50% { transform: translate(4px, -6px); } }
@media (prefers-reduced-motion: reduce) { .pwa-arrow-bottom, .pwa-arrow-top { animation: none; } }
html[data-pwa="ios"] .pwa-page { padding-bottom: 150px; }

/* Forsiden i appen: "Trender lige nu" vises ikke (websiden beholder den) */
html.is-app .sec-trend { display: none; }
