/* U-OS i nettleseren (ui/web/web.js). Samme tema som unorp.no og panel.unorp.no
   (uno-bot/web/app/globals.css): varm svart, glassflater, UNO-gull, Inter / Bebas Neue / Oswald. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Bebas+Neue&family=Oswald:wght@500;600&display=swap');
:root {
  --unw-bg: #080705; --unw-flate: #110f0b; --unw-flate-2: #1a1712;
  --unw-glass: rgba(255,255,255,.035); --unw-glass-hover: rgba(255,255,255,.06);
  --unw-tx: #f4f1ea; --unw-tx2: #d2cabb; --unw-dempet: #b3ab9c; --unw-svak: #7a7365;
  --unw-line: rgba(255,255,255,.08); --unw-line-sterk: rgba(255,255,255,.16);
  --unw-ac: #ffb200; --unw-ac-hover: #ffc233; --unw-knapp-tx: #140e02;
  --unw-ok: #4ade80; --unw-feil: #fb7185;
  --unw-skygge: 0 14px 34px -18px rgba(0,0,0,.8);
  --unw-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --unw-inter: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --unw-display: 'Bebas Neue', Impact, sans-serif;
  --unw-label: 'Oswald', 'Arial Narrow', sans-serif;
}
html, body { overflow: hidden; }
body.unoweb { background: var(--unw-bg); color: var(--unw-tx); font: 15px/1.6 var(--unw-inter); -webkit-font-smoothing: antialiased; user-select: auto; }
body.unoweb ::selection { background: rgba(255,178,0,.35); }

/* Bakgrunn fra unorp.no: byglød nedenfra, skumring ovenfra, filmkorn og Los Santos (skyline.js) */
.unw-haze { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 60% at 70% 115%, rgba(255,140,20,.16), transparent 60%),
              radial-gradient(90% 50% at 10% -10%, rgba(194,56,107,.09), transparent 60%),
              radial-gradient(70% 45% at 100% 0%, rgba(255,178,0,.07), transparent 65%); }
.unw-grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.unw-byen { position: fixed; top: 0; left: 0; right: 0; z-index: -1; pointer-events: none; height: calc(68px + clamp(240px, 24vw, 320px)); }
.unw-byen.foran { z-index: 0; }
.unw-byen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#skyline { mask-image: linear-gradient(to bottom, #000 70%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); }
#sky-light { mix-blend-mode: screen; }
/* Telefonen/tableten er oppe: byen dempes, saa enheten er det man ser */
body.unw-phone .unw-byen { opacity: .45; transition: opacity .6s; }

/* Telefonen midt paa skjermen i stedet for nede i hjoernet */
body.unoweb #anchor { inset: 0 !important; padding-top: 56px; display: flex; align-items: center; justify-content: center; }
body.unoweb #anchor #scaler { transform-origin: 50% 50% !important; }

/* Innlogging og «Velg enhet»: glasskortet fra panelet */
.unw-over { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.unw-over[hidden] { display: none; }
.unw-card { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; padding: 2.1rem 1.9rem 1.6rem; text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.012) 55%), rgba(17,15,11,.62);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--unw-line); border-radius: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 44px rgba(0,0,0,.35); }
.unw-card.busy { opacity: .6; pointer-events: none; }
.unw-logo { display: block; width: 150px; height: auto; margin: 0 auto .8rem; filter: drop-shadow(0 0 18px rgba(255,178,0,.25)); }
.unw-card h1 { margin: 0 0 .6rem; font: 400 3.1rem/.95 var(--unw-display); letter-spacing: .02em; text-shadow: 0 2px 18px rgba(0,0,0,.75); }
.unw-card h1 em { display: inline-block; font-style: normal; color: var(--unw-ac); transform: skewX(-9deg); padding-right: .06em;
  text-shadow: .045em .05em 0 #000, 0 0 .6em rgba(255,178,0,.3); }
.unw-sub { margin: 0 0 1.3rem; color: var(--unw-dempet); font-size: .92rem; line-height: 1.55; }
.unw-msg { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 12px; text-align: left; font-size: .9rem; line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--unw-feil) 40%, transparent); background: color-mix(in srgb, var(--unw-feil) 8%, var(--unw-flate)); }
.unw-body { display: flex; flex-direction: column; gap: 12px; text-align: left; }

/* Knapper: gull pille med Oswald i store bokstaver */
.unw-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; align-self: center; padding: .8rem 1.6rem; border-radius: 999px; border: 0;
  background: var(--unw-ac); color: var(--unw-knapp-tx); font: 500 .9rem/1 var(--unw-label); letter-spacing: .07em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: background .2s, transform .3s var(--unw-ease); }
.unw-btn:hover { background: var(--unw-ac-hover); transform: translateY(-1px); }
.unw-ghost { background: var(--unw-flate); color: var(--unw-tx); border: 1px solid var(--unw-line); }
.unw-ghost:hover { background: var(--unw-flate-2); }
.unw-dev { display: flex; gap: 8px; }
.unw-dev input { flex: 1; min-width: 0; padding: .65rem .9rem; border-radius: 10px; border: 1px solid var(--unw-line); background: var(--unw-flate); color: var(--unw-tx); font: 14px var(--unw-inter); }

/* Karakterer og enheter */
.unw-char { border: 1px solid var(--unw-line); border-radius: 14px; padding: .8rem; background: var(--unw-glass); }
.unw-char-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 .15rem .5rem; }
.unw-char-name { font: 600 1rem/1.2 var(--unw-inter); }
.unw-tag { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--unw-dempet);
  background: color-mix(in srgb, currentColor 12%, transparent); }
.unw-tag.on { color: var(--unw-ok); }
.unw-none, .unw-empty { color: var(--unw-dempet); font-size: .88rem; margin: 0 .15rem; }
.unw-phone-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: .65rem .75rem; margin-top: 6px; border-radius: 12px; border: 1px solid var(--unw-line);
  background: var(--unw-flate); color: var(--unw-tx); text-align: left; cursor: pointer; font: inherit; transition: border-color .2s, background .2s; }
.unw-phone-btn:hover:not(:disabled) { border-color: rgba(255,178,0,.45); background: rgba(255,178,0,.07); }
.unw-phone-btn:disabled { opacity: .45; cursor: not-allowed; }
.unw-model { flex: none; width: 20px; height: 34px; border-radius: 5px; border: 2px solid var(--unw-svak); box-sizing: border-box; }
.unw-phone-btn:hover:not(:disabled) .unw-model { border-color: var(--unw-ac); }
.unw-model.m-uflip { height: 24px; border-radius: 4px; }
.unw-model.m-ufold { width: 28px; }
.unw-model.m-utablet { width: 34px; height: 24px; border-radius: 4px; margin: 5px -7px; }   /* liggende tablet */
.unw-phone-txt { display: flex; flex-direction: column; gap: 2px; }
.unw-phone-txt b { font-size: .95rem; font-weight: 600; }
.unw-phone-txt small { color: var(--unw-dempet); font-size: .78rem; letter-spacing: .02em; }
.unw-link { align-self: center; background: none; border: 0; color: var(--unw-dempet); font: 500 .9rem var(--unw-inter); cursor: pointer; padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background .2s; }
.unw-link:hover { color: var(--unw-tx); background: var(--unw-glass-hover); }

/* Topplinja: som panelets meny, glass med UNO-merket i gull */
.unw-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 4px;
  width: min(760px, calc(100vw - 32px)); box-sizing: border-box; padding: 6px 8px 6px 10px; border-radius: 999px;
  background: rgba(8,7,5,.74); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--unw-line); font-size: .9rem; white-space: nowrap; }
.unw-bar[hidden] { display: none; }
.unw-chip { font: 600 .78rem/1 var(--unw-label); letter-spacing: .14em; text-transform: uppercase; color: var(--unw-ac); padding: .4rem .75rem; border-radius: 999px;
  background: rgba(255,178,0,.1); box-shadow: inset 0 0 0 1px rgba(255,178,0,.3); margin-right: 6px; }
.unw-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.unw-gap { flex: 1; }
.unw-reopen { display: none; position: fixed; left: 50%; bottom: 8vh; transform: translateX(-50%); z-index: 80; padding: .95rem 1.8rem; border-radius: 999px; border: 0;
  background: var(--unw-ac); color: var(--unw-knapp-tx); font: 500 .95rem/1 var(--unw-label); letter-spacing: .07em; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); }
body.unw-phone.unw-closed .unw-reopen { display: block; }

/* ---------- Mobil (web.js setter unw-mobile): skjermen fyller nettleseren, uten ramme ---------- */
html { overscroll-behavior: none; }
.unw-mbtn, .unw-sheet, .unw-rotate { display: none; }
body.unw-mobile { -webkit-tap-highlight-color: transparent; }
body.unw-mobile .unw-bar { display: none !important; }
body.unw-mobile #anchor { padding: 0; }
body.unw-mobile .dev { background: transparent !important; box-shadow: none !important; }
body.unw-mobile .dev .screen { border-radius: 0 !important; }
body.unw-mobile .sbtn, body.unw-mobile .hinge, body.unw-mobile .lens-row, body.unw-mobile .engrave,
body.unw-mobile #ucase, body.unw-mobile #ucasef { display: none !important; }
body.unw-mobile #lock, body.unw-mobile #homebar { touch-action: none; }   /* sveip opp uten at nettleseren tar bevegelsen */
body.unw-mobile input, body.unw-mobile textarea { font-size: max(16px, 1em); }
body.unw-mobile .unw-card { max-height: calc(100dvh - 32px); padding: 22px 18px 18px; border-radius: 18px; }
body.unw-mobile .unw-over { padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); align-items: flex-start; }
body.unw-mobile .unw-reopen { bottom: max(24px, env(safe-area-inset-bottom)); }

/* Liten menyknapp nede til hoeyre (karakter, legg bort, bytt enhet, logg ut) */
body.unw-mobile.unw-phone .unw-mbtn { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px;
  position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 95;
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(15,16,20,.55); backdrop-filter: blur(6px); opacity: .7; }
body.unw-mobile.unw-phone .unw-mbtn span { width: 4px; height: 4px; border-radius: 50%; background: #fff; }
body.unw-mobile .unw-sheet:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: 110; align-items: flex-end; background: rgba(0,0,0,.45); }
.unw-sheet-box { width: 100%; box-sizing: border-box; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); background: var(--unw-flate);
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; gap: 8px; }
.unw-sheet-who { color: var(--unw-tx2); font-size: 14px; text-align: center; padding: 4px 0 6px; }
.unw-sheet-btn { width: 100%; padding: 14px; border-radius: 12px; border: 0; background: rgba(255,255,255,.07); color: var(--unw-tx);
  font: 500 .95rem/1 var(--unw-label); letter-spacing: .07em; text-transform: uppercase; }
.unw-sheet-cancel { background: transparent; color: var(--unw-tx2); }

/* Tableten paa mobil: brukes liggende */
@media (orientation: portrait) {
  body.unw-mobile.unw-tab.unw-phone .unw-rotate { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px; background: var(--unw-bg); color: var(--unw-tx); text-align: center; padding: 24px; }
}
.unw-rotate b { font: 400 2rem/1 var(--unw-display); letter-spacing: .02em; }
.unw-rotate span { color: var(--unw-tx2); font-size: 15px; }
.unw-rotate-ic { width: 34px; height: 54px; border: 3px solid var(--unw-ac); border-radius: 8px; margin-bottom: 10px; animation: unwRot 2.4s ease-in-out infinite; }
@keyframes unwRot { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }

body.unw-mobile .unw-logo { width: 110px; margin-bottom: .5rem; }
body.unw-mobile .unw-card h1 { font-size: 2.6rem; }
