/* Sykepleier vs. Renta */
html.sg-lock, html.sg-lock body { overflow: hidden !important; overscroll-behavior: none; }

.sg {
	--sg-bg: #0c1016;
	--sg-ink: #eef2f6;
	--sg-muted: #a7b3c1;
	--sg-accent: #ff5a3c;
	--sg-teal: #26a69a;
	position: fixed; inset: 0; z-index: 2147483000;
	display: none; align-items: center; justify-content: center;
	background: var(--sg-bg);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--sg-ink);
	-webkit-tap-highlight-color: transparent;
	-webkit-font-smoothing: antialiased;
	line-height: 1.45;
}
.sg.is-open { display: flex; }
.sg *, .sg *::before, .sg *::after { box-sizing: border-box; }
.sg :where(p, h2, ul, ol, li, figure, blockquote, form, label) { margin: 0; padding: 0; color: inherit; font-family: inherit; letter-spacing: normal; text-transform: none; }

/* Spillflaten: hele skjermen på mobil, stående søyle på PC */
.sg-frame {
	position: relative;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
.sg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* HUD */
.sg-hud {
	position: absolute; left: 0; right: 0; top: 0;
	padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
	background: linear-gradient(180deg, rgba(12, 16, 22, .92), rgba(12, 16, 22, .72) 70%, rgba(12, 16, 22, 0));
	pointer-events: none;
	opacity: 0; transition: opacity .2s;
}
.sg.is-running .sg-hud, .sg-panel.is-on ~ .sg-hud { opacity: 1; }
.sg.is-running .sg-hud { opacity: 1; }
.sg-hud-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding-right: 88px; }
.sg-shift { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sg-shift-lbl { white-space: nowrap; font-size: 12px; color: var(--sg-muted); text-transform: uppercase; letter-spacing: .06em; }
.sg-shift-lbl b { color: var(--sg-ink); }
.sg-bar { display: block; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.sg-bar i { display: block; height: 100%; width: 0; background: var(--sg-teal); border-radius: 6px; }
.sg-score { text-align: center; display: flex; flex-direction: column; line-height: 1.1; }
.sg-score b { font-size: 22px; font-variant-numeric: tabular-nums; }
.sg-score span { font-size: 11px; color: var(--sg-muted); }
.sg-lives { display: flex; justify-content: flex-end; gap: 5px; }
.sg-lives i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: inline-block; }
.sg-lives i.on { background: var(--sg-teal); box-shadow: 0 0 0 2px rgba(38, 166, 154, .35); }
.sg-lives i.vikar { background: #7a5cff; color: #fff; font-size: 9px; font-style: normal; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.sg-interest { margin-top: 6px; font-size: 12px; color: var(--sg-muted); font-variant-numeric: tabular-nums; }
.sg-interest b { color: #ffb199; }


/* Nivåstien */
.sg-levels { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.sg-levels li {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 999px;
	background: rgba(255, 255, 255, .07); font-size: 13px; font-weight: 700; color: var(--sg-muted);
}
.sg-levels li span {
	width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
	display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.sg-levels li.done { color: #bfe9e4; }
.sg-levels li.done span { background: var(--sg-teal); }
.sg-levels li.now { color: #fff; background: rgba(255, 90, 60, .22); }
.sg-levels li.now span { background: var(--sg-accent); }
.sg-levels li.k8 { color: #f2d77c; }
.sg-levels li.k8 span { background: #b8962e; }

/* Gull for K8 */
.sg .sg-kicker.sg-kicker--gold { color: #e9c75b; }
.sg .sg-btn.sg-btn--gold { background: linear-gradient(135deg, #e9c75b, #b8962e); border-color: #d4af37; color: #1a1406; }
.sg-memo--gold { background: #fbf3d6; }
.sg-memo--gold span { color: #8a6a12; }
.sg-panel.is-k8 { background: radial-gradient(ellipse at top, rgba(60, 48, 18, .96), rgba(14, 12, 8, .97) 70%); }
.sg-k8 { text-align: center; padding: 8px 0 4px; }
.sg-k8-who { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: #1a1406; background: #e9c75b; border-radius: 999px; padding: 4px 12px; margin: 10px 0 12px; }
.sg-k8 .sg-title { color: #fff; }
.sg-k8-out { margin-top: 10px; font-size: clamp(17px, 4.6vw, 21px); font-weight: 700; color: #f2d77c; }
.sg-k8-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sg-k8-facts div { background: rgba(233, 199, 91, .1); border: 1px solid rgba(233, 199, 91, .35); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.sg-k8-facts b { font-size: 18px; color: #f2d77c; line-height: 1.1; }
.sg-k8-facts span { font-size: 12px; color: #e7dcc0; line-height: 1.3; }
.sg-k8-facts a, .sg-panel.is-k8 .sg-small a { color: #f2d77c; }
.sg.is-k8 .sg-bar i { background: #d4af37; }

/* Elementer som bare vises i bred visning */
.sg-path, .sg-help, .sg-feed { display: none; }

/* ---------- Bred visning: PC og Mac ---------- */
.sg.is-wide .sg-hud {
	right: auto; bottom: 0; width: var(--sg-side, 300px);
	padding: 24px clamp(20px, 2.4vw, 40px) 110px;
	background: none;
	display: flex; flex-direction: column; gap: 14px;
	opacity: 1;
}
.sg.is-wide .sg-hud-row { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-right: 0; }
.sg.is-wide .sg-shift { width: 100%; max-width: 320px; }
.sg.is-wide .sg-shift-lbl { font-size: 15px; white-space: normal; }
.sg.is-wide .sg-bar { height: 8px; }
.sg.is-wide .sg-score { text-align: left; }
.sg.is-wide .sg-score b { font-size: clamp(36px, 3.4vw, 56px); }
.sg.is-wide .sg-score span { font-size: 13px; }
.sg.is-wide .sg-lives i { width: 18px; height: 18px; }
.sg.is-wide .sg-interest { font-size: 15px; margin-top: 0; }
.sg.is-wide .sg-interest b { font-size: 22px; color: #ff8a70; }
.sg.is-wide .sg-path { display: block; max-width: 320px; }
.sg.is-wide .sg-path > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--sg-muted); margin-bottom: 8px; }
.sg.is-wide .sg-path .sg-levels { flex-direction: column; align-items: flex-start; }
.sg.is-wide .sg-help { display: flex; flex-direction: column; gap: 4px; margin-top: auto; font-size: 13px; color: var(--sg-muted); }
.sg-help .sg-t { display: none; }
@media (pointer: coarse) { .sg-help .sg-k { display: none; } .sg-help .sg-t { display: block; } }
.sg.is-wide .sg-help b { color: var(--sg-ink); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }
.sg.is-wide .sg-hud > * { background: rgba(12, 16, 22, .78); border-radius: 14px; padding: 14px 16px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sg.is-wide .sg-hud > * { width: 100%; max-width: 340px; }
.sg.is-wide .sg-toast { display: none; }
.sg.is-wide .sg-feed {
	display: block; position: absolute; right: 0; top: 0; width: var(--sg-side, 300px);
	padding: 76px clamp(20px, 2.4vw, 40px) 32px; pointer-events: none;
}
.sg.is-wide .sg-feed-h { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #ffb199; font-weight: 800; margin-bottom: 10px; }
.sg.is-wide .sg-feed ol { list-style: none; display: grid; gap: 10px; max-width: 380px; }
.sg.is-wide .sg-feed li {
	background: rgba(255, 255, 255, .94); color: #13202b; border-radius: 14px; padding: 12px 14px;
	font-size: 15px; font-weight: 600; line-height: 1.35; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.sg.is-wide .sg-feed li:first-child { animation: sg-in .25s ease-out; }
.sg.is-wide .sg-feed li:nth-child(n+2) { opacity: .72; }
.sg.is-wide .sg-feed li:nth-child(n+4) { opacity: .45; }
.sg.is-wide .sg-ctrl { top: 20px; right: 20px; }
.sg.is-wide .sg-icon { width: 46px; height: 46px; }
.sg.is-wide .sg-panel { background: rgba(10, 14, 20, .82); padding-top: 72px; }
.sg.is-wide .sg-panel > * { max-width: 560px; }
.sg.is-wide .sg-title { font-size: 52px; }
.sg.is-wide .sg-title--sm { font-size: 32px; }
.sg.is-wide .sg-panel:not(.is-on) ~ .sg-feed { opacity: 1; }

/* Kontrollknapper */
.sg-ctrl {
	position: absolute; top: calc(env(safe-area-inset-top, 0px) + 8px); right: 10px;
	display: flex; gap: 8px; z-index: 5;
}
.sg .sg-icon {
	appearance: none; width: 40px; height: 40px; border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, .18); background: rgba(12, 16, 22, .7); color: #fff;
	font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center;
}
.sg .sg-icon[data-sg-act="pause"] { display: none; }
.sg.is-running .sg-icon[data-sg-act="pause"] { display: inline-flex; }

/* Liggende telefon: be om å snu */
.sg-rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
	.sg-rotate {
		display: flex; position: absolute; inset: 0; z-index: 6; align-items: center; justify-content: center;
		background: var(--sg-bg); text-align: center; padding: 24px;
	}
	.sg-rotate b { display: block; font-size: 22px; margin-bottom: 6px; }
	.sg-rotate span { color: var(--sg-muted); font-size: 15px; }
	.sg-rotate div::before {
		content: ""; display: block; width: 34px; height: 56px; margin: 0 auto 14px; border: 3px solid #fff; border-radius: 8px;
		transform: rotate(-90deg); animation: sg-rot 1.6s ease-in-out infinite alternate;
	}
	.sg-frame { width: 100vw; }
}
@keyframes sg-rot { from { transform: rotate(-90deg); } to { transform: rotate(0deg); } }

/* Direktørens meldinger */
.sg-toast {
	position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 84px);
	background: rgba(255, 255, 255, .9); color: #13202b; border-radius: 14px; padding: 8px 12px 9px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2); pointer-events: none; z-index: 2;
	font-size: 13px; line-height: 1.3; font-weight: 600;
}
.sg-toast[hidden] { display: none; }
.sg-toast.is-in { animation: sg-in .25s ease-out; }
.sg-toast-who { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #c2412b; font-weight: 800; margin-bottom: 2px; }
@keyframes sg-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Paneler */
.sg-panel {
	position: absolute; inset: 0; z-index: 4;
	display: none; flex-direction: column; justify-content: center; gap: 14px;
	padding: calc(env(safe-area-inset-top, 0px) + 64px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
	background: rgba(10, 14, 20, .9);
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	overflow-y: auto; -webkit-overflow-scrolling: touch;
	touch-action: pan-y;
	user-select: text; -webkit-user-select: text;
}
.sg-panel.is-on { display: flex; }
.sg-panel.is-over { justify-content: flex-start; }
.sg-panel > * { width: 100%; max-width: 440px; margin-left: auto; margin-right: auto; }
.sg-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #ffb199; font-weight: 800; }
.sg-title { font-size: clamp(30px, 9vw, 42px); font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.sg-title--sm { font-size: clamp(21px, 6vw, 27px); line-height: 1.2; letter-spacing: -.01em; }
.sg-lead { font-size: 16px; color: var(--sg-ink); }
.sg-how { list-style: none; display: grid; gap: 8px; }
.sg-how li { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--sg-muted); }
.sg-how b { color: var(--sg-ink); }
.sg-small { font-size: 13px; color: var(--sg-muted); }
.sg-fine { font-size: 11px; color: #7d8a99; }
.sg .sg-linkbtn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: #ffb199; text-decoration: underline; cursor: pointer; }
.sg .sg-linkbtn:focus-visible { outline: 2px solid #ffd27a; outline-offset: 2px; }
.sg-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.sg .sg-btn {
	appearance: none; flex: 1 1 140px; min-height: 50px; padding: 12px 18px;
	border-radius: 14px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff;
	font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; line-height: 1.15;
}
.sg .sg-btn--go { background: var(--sg-accent); border-color: var(--sg-accent); }
.sg .sg-btn:disabled { opacity: .5; cursor: default; }
.sg .sg-btn:focus-visible, .sg .sg-icon:focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }

.sg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sg-stats div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sg-stats b { font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sg-stats span { font-size: 11px; color: var(--sg-muted); line-height: 1.25; }

.sg-memo { background: #fff; color: #13202b; border-radius: 14px; padding: 12px 14px; font-size: 15px; font-weight: 600; }
.sg-memo span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #c2412b; font-weight: 800; margin-bottom: 4px; }

.sg-fact { border-left: 4px solid var(--sg-accent); background: rgba(255, 90, 60, .08); border-radius: 0 12px 12px 0; padding: 12px 14px; }
.sg-fact blockquote { font-size: 16px; font-weight: 700; }
.sg-fact--q blockquote { font-size: 20px; }
.sg-fact figcaption { margin-top: 6px; font-size: 12px; color: var(--sg-muted); }
.sg-fact a { color: #ffb199; }

.sg-closing { font-size: 14px; font-weight: 700; color: var(--sg-ink); text-align: center; padding-top: 4px; }

@media (max-width: 380px) {
	.sg-k8-facts, .sg-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
	.sg-k8-facts b { font-size: 15px; }
}
@media (max-height: 640px) {
	.sg-panel { gap: 10px; justify-content: flex-start; }
	.sg-how li { padding: 8px 10px; font-size: 13px; }
	.sg-lead { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
	.sg-toast.is-in, .sg-rotate div::before, .sg.is-wide .sg-feed li:first-child { animation: none; }
}
