@font-face {
  font-family: 'VT323'; /* OFL leyfi; dekkar Latin-1 (ð þ æ ö ý) */
  src: url('assets/fonts/vt323.woff2') format('woff2');
  font-display: swap;
}
:root {
  --ui-gold: #e0a13a;
  --ui-gold-pale: #ffe6a0;
  --ui-ink: #12100d;
  --ui-button-normal: url('assets/ui/button_normal.png?v=2');
  --ui-button-hover: url('assets/ui/button_hover.png?v=2');
  --ui-button-active: url('assets/ui/button_active.png?v=2');
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; height: 100dvh; background: #0c0c10; overflow: hidden;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font-family: 'VT323', "Courier New", monospace; }
#game-root { height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0; }
#stage-wrap { position: relative; width: min(100vw, calc((100dvh - 130px) * 16 / 9));
  aspect-ratio: 16 / 9; background: #000; }
#stage { width: 100%; height: 100%; image-rendering: pixelated; display: block; touch-action: none; }
#overlay, #speech-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#speech-layer { z-index: 60; }
#fade { position: absolute; inset: 0; z-index: 70; background: #000; opacity: 1; pointer-events: none; }

/* --- tebollinn: leikstýrð pixel-klippisena --- */
.tea-vision { position: absolute; inset: 0; z-index: 50; overflow: hidden;
  pointer-events: auto; background: #08070a; image-rendering: pixelated; }
.tea-vision::before { content: ''; position: absolute; inset: -4%;
  background: #08070a url('assets/bg/s5b_hearth.png') center / cover no-repeat;
  filter: brightness(.24) saturate(.55) sepia(.2); transform: scale(1.05); }
.tea-vision img { position: absolute; display: block; image-rendering: pixelated; }
.tea-vision-flash { position: absolute; inset: 0; z-index: 7; opacity: 0;
  background: #dce6df; mix-blend-mode: screen; pointer-events: none; }
.tea-vision-cup { z-index: 4; left: 50%; bottom: 3%; width: 19%;
  transform: translateX(-50%); filter: drop-shadow(0 8px 4px rgba(0,0,0,.85)); }
.tea-vision-ghost { z-index: 3; left: 50%; bottom: 12%; width: 48%; opacity: 0;
  transform: translateX(-50%); filter: drop-shadow(0 0 7px rgba(204,231,238,.45)); }
.tea-vision-magnus { z-index: 6; right: -1%; bottom: -17%; width: 42%; opacity: 0;
  filter: drop-shadow(-8px 5px 0 rgba(0,0,0,.6)); transform-origin: 75% 85%; }
.tea-vision-jon { position: absolute; z-index: 5; left: 4%; bottom: -1%;
  width: 16%; height: 63%; opacity: 0; transform-origin: center bottom;
  background: url('assets/sprites/jon_idle.png') left bottom / auto 100% no-repeat;
  image-rendering: pixelated; filter: brightness(.7) drop-shadow(4px 3px 0 rgba(0,0,0,.75)); }
.tea-vision-thump { position: absolute; z-index: 8; left: 6%; top: 15%; opacity: 0;
  color: #fff0ae; font-size: clamp(26px, 7vw, 66px); line-height: .8;
  text-shadow: 3px 3px 0 #5b2519, -2px -2px 0 #160c09; transform: rotate(-8deg); }
.tea-vision-caption { position: absolute; z-index: 8; left: 5%; bottom: 8%; opacity: 0;
  max-width: 34%; color: #f0e3bf; font-size: clamp(13px, 2.1vw, 20px);
  line-height: 1.05; text-align: left; text-shadow: 2px 2px 0 #000; }
.tea-vision.playing { animation: tea-vision-stage 5.8s steps(10, end) both; }
.tea-vision.playing::before { animation: tea-vision-room 5.8s steps(12, end) both; }
.tea-vision.playing .tea-vision-cup { animation: tea-vision-cup 5.8s steps(12, end) both; }
.tea-vision.playing .tea-vision-ghost { animation: tea-vision-ghost 5.8s steps(16, end) both; }
.tea-vision.playing .tea-vision-magnus { animation: tea-vision-magnus 5.8s steps(10, end) both; }
.tea-vision.playing .tea-vision-jon { animation: tea-vision-jon 5.8s steps(4, end) both; }
.tea-vision.playing .tea-vision-thump { animation: tea-vision-thump 5.8s steps(4, end) both; }
.tea-vision.playing .tea-vision-caption { animation: tea-vision-caption 5.8s steps(5, end) both; }
.tea-vision.playing .tea-vision-flash { animation: tea-vision-flash 5.8s steps(2, end) both; }
@keyframes tea-vision-stage {
  0% { opacity: 0; } 7%, 88% { opacity: 1; } 100% { opacity: 0; }
}
@keyframes tea-vision-room {
  0% { transform: scale(1.05); } 58% { transform: scale(1.14); }
  100% { transform: scale(1.18); }
}
@keyframes tea-vision-cup {
  0%, 5% { opacity: 0; transform: translateX(-50%) scale(.55); }
  16%, 88% { opacity: 1; transform: translateX(-50%) scale(1.18); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.3); }
}
@keyframes tea-vision-ghost {
  0%, 17% { opacity: 0; transform: translate(-50%, 24%) scale(.18, .08); }
  30% { opacity: .42; transform: translate(-50%, 13%) scale(.58, .42); }
  43%, 56% { opacity: .94; transform: translate(-50%, 0) scale(1); }
  67%, 100% { opacity: 0; transform: translate(-50%, -8%) scale(1.13, 1.24); }
}
@keyframes tea-vision-magnus {
  0%, 35% { opacity: 0; transform: translate(18%, 12%) scale(.62); }
  42% { opacity: 1; transform: translate(0, 0) scale(1.14); }
  47%, 68% { opacity: 1; transform: translate(0, 0) scale(1); }
  76%, 100% { opacity: 0; transform: translate(6%, 3%) scale(.94); }
}
@keyframes tea-vision-jon {
  0%, 18% { opacity: 0; transform: scaleX(1); }
  25%, 50% { opacity: .86; transform: scaleX(1); }
  54%, 76% { opacity: 1; transform: translateX(-14%) scaleX(-1); }
  84%, 100% { opacity: 0; transform: translateX(-14%) scaleX(-1); }
}
@keyframes tea-vision-thump {
  0%, 50% { opacity: 0; transform: translate(-18px, 8px) rotate(-8deg) scale(.45); }
  54%, 63% { opacity: 1; transform: translate(0, 0) rotate(-8deg) scale(1); }
  70%, 100% { opacity: 0; transform: translate(8px, -4px) rotate(-8deg) scale(1.1); }
}
@keyframes tea-vision-caption {
  0%, 53% { opacity: 0; } 59%, 76% { opacity: 1; } 84%, 100% { opacity: 0; }
}
@keyframes tea-vision-flash {
  0%, 51% { opacity: 0; } 53% { opacity: .32; } 56%, 100% { opacity: 0; }
}

/* --- lokasting: álfasteinninn kominn í lest freygátunnar --- */
.frigate-sting { position: absolute; inset: 0; z-index: 55; overflow: hidden;
  pointer-events: auto; background: #020202; opacity: 0; image-rendering: pixelated; }
.frigate-sting.playing { opacity: 1; transition: opacity .75s steps(8, end); }
.frigate-sting img { position: absolute; inset: -2%; width: 104%; height: 104%;
  object-fit: cover; image-rendering: pixelated; transform-origin: 66% 64%; }
.frigate-sting.playing img { animation: frigate-sting-creep 8.5s steps(20, end) both; }
.frigate-sting-vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 65% 58%, transparent 20%, rgba(0,0,0,.22) 61%, rgba(0,0,0,.68) 100%); }
.frigate-sting-glow { position: absolute; left: 56%; top: 50%; width: 18%; height: 30%;
  border-radius: 50%; opacity: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse, rgba(211,255,211,.48), rgba(155,224,169,.14) 42%, transparent 72%);
  filter: blur(3px); transform: translate(-50%, -50%); }
.frigate-sting.breathing .frigate-sting-glow {
  animation: frigate-sting-breathe 3.2s steps(8, end) infinite; }
@keyframes frigate-sting-creep {
  from { transform: scale(1); } to { transform: scale(1.055); }
}
@keyframes frigate-sting-breathe {
  0%, 100% { opacity: .2; transform: translate(-50%, -50%) scale(.8); }
  48% { opacity: .82; transform: translate(-50%, -50%) scale(1.18); }
}

.speech { position: absolute; transform: translateX(-50%); max-width: 46%;
  text-align: center; font-weight: bold; font-size: clamp(14px, 2.1vw, 21px); letter-spacing: 0.5px;
  line-height: 1.25; text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000,
  -1px -1px 0 #000, 0 2px 2px rgba(0,0,0,.8); white-space: pre-wrap; }
.speech-language { display: block; margin-bottom: 2px; font-size: .72em;
  font-style: normal; letter-spacing: 1.2px; opacity: .85; }
.speech-translation { display: block; font-style: italic; }

#ui-bar { width: min(100vw, calc((100dvh - 130px) * 16 / 9)); background: #100f0d;
  border-top: 2px solid #b76d25; box-shadow: inset 0 2px 0 #3a2f20;
  padding: 4px 8px 8px; color: #e8ce91; }
#sentence-line { text-align: center; min-height: 20px; color: #ffe4a0;
  font-size: 14px; font-weight: bold; text-shadow: 1px 1px 0 #2b241c; }
#ui-cols { display: flex; gap: 10px; align-items: stretch; }
#verbs { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
#verbs button, #side-buttons button, #dialog-choices button, .panel button,
.title-menu button, .chapter-end-menu button {
  background: var(--ui-ink); color: #e8ce91; border: 6px solid transparent;
  border-image-source: var(--ui-button-normal); border-image-slice: 8 fill;
  border-image-width: 6px; border-image-repeat: stretch;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .48); image-rendering: pixelated;
  font-family: inherit; font-size: 13px; font-weight: bold; line-height: 1;
  min-height: 30px; padding: 3px 8px; cursor: pointer; }
#verbs button:hover, #side-buttons button:hover, #dialog-choices button:hover,
.panel button:hover, .title-menu button:hover, .chapter-end-menu button:hover {
  border-image-source: var(--ui-button-hover); color: var(--ui-gold-pale); }
#verbs button.active, #side-buttons button.active {
  border-image-source: var(--ui-button-active); color: #fff2b8;
  transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .5); }
#verbs button:focus-visible, #side-buttons button:focus-visible,
#dialog-choices button:focus-visible, .panel button:focus-visible,
.title-menu button:focus-visible, .chapter-end-menu button:focus-visible {
  outline: 2px solid #fff2b8; outline-offset: 1px; }
#verbs button {
  --verb-art: none;
  width: 86px; height: 27px; min-height: 27px; padding: 0;
  border: 0; border-image: none; border-radius: 0; box-shadow: none;
  background: transparent var(--verb-art) center / 100% 100% no-repeat;
  color: transparent; font-size: 0; line-height: 0; image-rendering: pixelated;
}
#verbs button[data-verb-art="skoda"] { --verb-art: url('assets/ui/verb_skoda.png?v=2'); }
#verbs button[data-verb-art="tala"] { --verb-art: url('assets/ui/verb_tala.png?v=2'); }
#verbs button[data-verb-art="taka"] { --verb-art: url('assets/ui/verb_taka.png?v=2'); }
#verbs button[data-verb-art="nota"] { --verb-art: url('assets/ui/verb_nota.png?v=2'); }
#verbs button[data-verb-art="opna"] { --verb-art: url('assets/ui/verb_opna.png?v=2'); }
#verbs button[data-verb-art="gefa"] { --verb-art: url('assets/ui/verb_gefa.png?v=2'); }
#verbs button[data-verb-art="skra"] { --verb-art: url('assets/ui/verb_skra.png?v=2'); }
#verbs button[data-verb-art="utskyra"] { --verb-art: url('assets/ui/verb_utskyra.png?v=2'); }
#verbs button:hover {
  border-image: none; color: transparent; filter: brightness(1.16) saturate(1.08);
}
#verbs button.active {
  border-image: none; color: transparent; filter: brightness(1.24) saturate(1.12);
  transform: translate(1px, 1px); box-shadow: none;
}
#inventory { flex: 1; display: flex; gap: 4px; align-items: center;
  overflow-x: auto; padding: 2px; }
.inv-item { width: 44px; height: 44px; background: var(--ui-ink); border: 6px solid transparent;
  border-image-source: var(--ui-button-normal); border-image-slice: 8 fill;
  border-image-width: 6px; border-image-repeat: stretch; image-rendering: pixelated;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex: 0 0 auto; }
.inv-item:hover { border-image-source: var(--ui-button-hover); }
.inv-item img { width: 32px; height: 32px; image-rendering: pixelated; }
#side-buttons { display: flex; flex-direction: row; align-items: center; align-self: center; gap: 3px; }
#side-buttons button { display: flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 38px; height: 34px; padding: 2px 4px; }
#side-buttons button::before { content: ''; display: block; width: 24px; height: 24px;
  flex: 0 0 24px; background-image: url('assets/ui/button_icons.png');
  background-repeat: no-repeat; background-size: 120px 24px; image-rendering: pixelated; }
#btn-switch { min-width: 78px !important; color: #f1d89a !important; }
#btn-switch::before { background-position: 0 0; }
#btn-hints::before { background-position: -24px 0; }
#btn-journal::before { background-position: -48px 0; }
#btn-pause::before { background-position: -72px 0; }
#btn-full::before { background-position: -96px 0; }
#btn-hints, #btn-journal, #btn-pause, #btn-full { font-size: 0 !important; }

/* --- hjálparmerkingar yfir smellanlegum senueiningum --- */
.hotspot-hint { position: absolute; transform: translate(-50%, calc(-100% - 7px));
  max-width: 42%; padding: 3px 7px; color: #fff0ae; background: rgba(18, 16, 24, .9);
  border: 1px solid #b69a49; box-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
  font-size: clamp(12px, 1.8vw, 17px); line-height: 1; text-align: center;
  white-space: normal; text-shadow: 1px 1px 0 #000; }
.hotspot-hint::after { content: ''; position: absolute; left: 50%; bottom: -5px;
  width: 7px; height: 7px; background: #ffe9a8; border: 1px solid #4f431f;
  transform: translateX(-50%) rotate(45deg); animation: hotspot-pulse 1.1s ease-in-out infinite; }
.hotspot-hint.actor-hint { color: #b8efc6; border-color: #5b9870; }
.hotspot-hint.actor-hint::after { background: #9fdfb0; border-color: #345640; }
@keyframes hotspot-pulse { 50% { opacity: .35; } }

.panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, 86vw); max-height: 78vh; overflow-y: auto; background: #1a1626;
  border: 2px solid #6b5f2e; padding: 18px; color: #e6dcb8; z-index: 40; }
.panel h2 { font-size: 16px; margin-bottom: 10px; color: #ffe9a8; }
.j-entry { margin-bottom: 12px; border-bottom: 1px dashed #4a4460; padding-bottom: 8px; }
.j-entry h3 { font-size: 14px; color: #ffe9a8; }
.j-entry p, .j-empty { font-size: 13px; line-height: 1.4; }
.hidden { display: none !important; }

#closeup-content { font-size: 14px; line-height: 1.5; }
#closeup-content .paper { background: #efe6c8; color: #3a3020; padding: 16px;
  font-style: italic; border: 1px solid #b8a878; }
#closeup-content .paper h3 { font-style: normal; margin-bottom: 8px; }
#closeup-content td { padding: 2px 10px 2px 0; }

#dialog-choices { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 4px; z-index: 30;
  width: min(620px, 92vw); }
#dialog-choices button { text-align: left; background: rgba(18, 16, 13, .96); }
#dialog-choices button:hover { color: #fff0ae; }

#title-card { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; z-index: 20;
  text-align: center; cursor: pointer; }
#title-card h1 { color: #ffe9a8; font-size: clamp(20px, 4vw, 42px);
  text-shadow: 2px 2px 0 #000; letter-spacing: 1px; }
#title-card h2 { color: #cfc7b0; font-size: clamp(12px, 2vw, 20px);
  text-shadow: 1px 1px 0 #000; font-weight: normal; }
#title-card .blink { color: #9fdfb0; font-size: 14px; animation: blink 1.4s infinite; }
.title-menu { display: flex; flex-direction: column; gap: 7px; min-width: 180px;
  pointer-events: auto; }
.title-menu button, .chapter-end-menu button { color: #ffe5a4; font-size: 16px; padding: 6px 18px; }
@keyframes blink { 50% { opacity: 0.15; } }

body.chapter-ending #ui-bar { visibility: hidden; }
#title-card.chapter-end-card { z-index: 75; cursor: default; pointer-events: auto;
  padding: 7%; background: #020202; animation: chapter-end-in .12s steps(2, end) both; }
.chapter-end-card .chapter-kicker { color: #789581; font-size: clamp(11px, 1.8vw, 16px);
  letter-spacing: 2px; }
.chapter-end-card h1 { font-size: clamp(28px, 5vw, 52px); }
.chapter-end-card h2 { color: #e2d3a9 !important; font-size: clamp(16px, 2.6vw, 27px) !important; }
.chapter-end-card .chapter-end-copy { color: #a7b5a7; font-size: clamp(13px, 2vw, 19px); }
.chapter-end-menu { display: flex; flex-direction: column; gap: 7px; min-width: 180px;
  margin-top: 10px; pointer-events: auto; }
@keyframes chapter-end-in { from { opacity: 0; } to { opacity: 1; } }

/* --- lifandi titilbakgrunnur --- */
#title-card.title-screen {
  justify-content: flex-start; overflow: hidden; isolation: isolate;
  padding: 2.5% 3% 3.5%;
  background: #090b11 url('assets/ui/title_scene.jpg') center 52% / cover no-repeat;
}
body.title-mode #ui-bar { display: none; }
body.title-mode #stage-wrap { width: min(100vw, calc(100dvh * 16 / 9)); }
.title-screen #side-buttons {
  position: absolute; top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right)); z-index: 3;
}
body.dev-mode.title-mode .title-screen #side-buttons {
  right: max(58px, calc(env(safe-area-inset-right) + 58px));
}
.title-screen #side-buttons > :not(#btn-pause) { display: none !important; }
.title-screen #btn-pause { width: 42px; height: 38px; }
.title-screen .title-background {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 52%; pointer-events: none;
}
.title-screen::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 28%, transparent 30%, rgba(5, 6, 10, .34) 100%),
    linear-gradient(to bottom, rgba(5, 6, 12, .08), transparent 48%, rgba(5, 4, 8, .22));
}
.title-screen > :not(.title-background) { position: relative; z-index: 2; }
.title-screen .title-plate {
  width: min(46%, 530px); max-height: 43%; margin-top: 0;
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, .72));
}
.title-screen h2 { color: #f1ddb0 !important; }
.title-screen .title-menu {
  min-width: min(230px, 58%); margin-top: auto; margin-bottom: 0;
}
.title-screen .title-audio-gate {
  position: absolute; inset: 0; z-index: 4; border: 0; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #ffe9a8; cursor: pointer;
  background: rgba(5, 6, 10, .38); font-family: inherit;
  text-shadow: 2px 2px 0 #000; -webkit-tap-highlight-color: transparent;
}
.title-screen .title-audio-gate span {
  padding: 9px 18px 8px; border: 2px solid #c58a3d;
  background: rgba(16, 15, 13, .88); box-shadow: 3px 3px 0 rgba(0, 0, 0, .58);
  font-size: clamp(16px, 2.4vw, 25px); letter-spacing: 1px;
}
.title-screen .title-audio-gate small {
  color: #f1ddb0; font-size: clamp(11px, 1.4vw, 15px); letter-spacing: .5px;
}
.title-screen .title-audio-gate:focus-visible span {
  outline: 2px solid #fff2b8; outline-offset: 3px;
}
.title-screen .title-audio-gate:disabled { cursor: wait; }
.title-screen.audio-gated h2,
.title-screen.audio-gated .title-menu,
.title-screen.audio-gated #side-buttons { visibility: hidden; }

/* --- hlé-valmynd --- */
#pause { position: absolute; inset: 0; z-index: 80; display: flex;
  align-items: center; justify-content: center; padding: 10px;
  background: rgba(8, 7, 12, .72); pointer-events: auto; }
#pause .pause-card { position: relative; top: auto; left: auto; transform: none;
  width: min(560px, 100%); max-height: calc(100% - 20px); }
#pause .p-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#pause .p-row label { width: 110px; font-size: 15px; }
#pause input[type="range"] { flex: 1; min-width: 0; accent-color: #ffe9a8;
  touch-action: none; }
#pause output { width: 42px; color: #ffe9a8; font-size: 14px; text-align: right; }
#pause .p-buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
#pause .p-slots button { padding: 6px 14px; }

/* --- toast --- */
#toast { position: absolute; right: 12px; bottom: 12px; background: rgba(20,19,26,.94);
  color: #ffe9a8; border: 1px solid #6b5f2e; padding: 8px 14px; font-size: 15px;
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; }

/* --- minnisbókar-ping --- */
#btn-journal.ping { animation: ping 1.2s steps(2, end) infinite; }
@keyframes ping { 50% { filter: brightness(1.45); transform: translateY(-1px); } }

/* --- verkefnalistinn --- */
.j-head { color: #ffe9a8; font-size: 15px; margin: 10px 0 6px; border-bottom: 1px solid #4a4460; }
.j-task { font-size: 15px; padding: 2px 0; }
.j-task.j-done { color: #8a8298; }

/* --- tæmd umræðuefni dofna --- */
#dialog-choices button.asked { color: #8a8298; }
#dialog-choices { max-height: 40vh; overflow-y: auto; }

/* --- þróunarhamur (?dev=1) --- */
#dev-toggle { position: absolute; top: 8px; right: 8px; z-index: 65;
  background: rgba(12,12,16,.9); color: #9fdfb0; border: 1px solid #4d8b65;
  font-family: inherit; font-size: 12px; font-weight: bold; padding: 4px 8px;
  cursor: pointer; box-shadow: 2px 2px 0 rgba(0,0,0,.45); }
#dev-toggle:hover { background: #20362a; }
#dev-panel { position: absolute; inset: 8px auto 8px 8px; z-index: 70;
  width: min(460px, calc(100% - 16px)); overflow-y: auto; pointer-events: auto;
  background: rgba(12,12,16,.97); color: #d7e8dc; border: 1px solid #4d8b65;
  box-shadow: 4px 4px 0 rgba(0,0,0,.55); padding: 10px; font-size: 13px; }
#dev-panel header { position: sticky; top: -10px; z-index: 1; margin: -10px -10px 8px;
  padding: 8px 10px; display: flex; align-items: center; justify-content: space-between;
  background: #142219; border-bottom: 1px solid #4d8b65; color: #9fdfb0; }
#dev-panel header strong { font-size: 16px; letter-spacing: .5px; }
#dev-panel button { background: #1d2a22; color: #d7e8dc; border: 1px solid #456650;
  font-family: inherit; font-size: 12px; padding: 5px 7px; cursor: pointer; text-align: left; }
#dev-panel button:hover, #dev-panel button.active { background: #31503c; color: #fff4bd;
  border-color: #8dc7a0; }
#dev-panel .dev-close { min-width: 28px; text-align: center; font-size: 18px; padding: 0 6px; }
.dev-current { color: #a9b9ae; margin-bottom: 6px; }
.dev-check { display: block; width: max-content; color: #bcd2c3; cursor: pointer; }
#dev-panel h3 { color: #9fdfb0; font-size: 13px; margin: 11px 0 5px;
  border-bottom: 1px solid #263c2d; padding-bottom: 3px; }
.dev-scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.dev-preset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
#dev-panel .dev-preset { display: flex; flex-direction: column; gap: 2px; min-height: 48px; }
.dev-preset b { color: #fff4bd; font-weight: normal; }
.dev-preset span { color: #9eaea3; font-size: 11px; line-height: 1.15; }
.dev-json, .dev-flags { margin-top: 10px; border-top: 1px solid #263c2d; padding-top: 7px; }
.dev-json summary, .dev-flags summary { color: #9fdfb0; cursor: pointer; }
.dev-json textarea { display: block; width: 100%; height: 150px; margin: 7px 0 5px;
  resize: vertical; background: #090c0a; color: #d7e8dc; border: 1px solid #456650;
  padding: 6px; font: 11px/1.25 "Courier New", monospace; tab-size: 2; }
.dev-flags pre { margin-top: 6px; color: #a9b9ae; font: 11px/1.35 "Courier New", monospace;
  white-space: pre-wrap; }

/* --- portrait-spilun: kamerugluggi + stórt þumal-UI --- */
#rotate-hint { display: none; }
body.portrait #rotate-hint {
  display: block; position: absolute; top: 8px; left: 50%; z-index: 60;
  transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  padding: 5px 10px; color: #fff0ae; background: rgba(18, 16, 24, .9);
  border: 1px solid #b69a49; box-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
  font-size: 14px; line-height: 1; text-align: center; pointer-events: none;
  animation: rotate-hint-fade 6s forwards;
}
@keyframes rotate-hint-fade {
  0%, 65% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
body.portrait #game-root { justify-content: flex-start; }
body.portrait #stage-wrap { width: 100vw; }
body.portrait #title-card.title-screen { padding-top: 42px; }
body.portrait #ui-bar { width: 100vw; padding: 6px 8px 14px; }
body.portrait #sentence-line { font-size: 15px; min-height: 22px; }
body.portrait #ui-cols { flex-direction: column; gap: 8px; }
body.portrait #verbs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
body.portrait #verbs button {
  width: 100%; height: 42px; min-height: 42px; padding: 0; background-size: 100% auto;
}
body.portrait #inventory { min-height: 52px; }
body.portrait .inv-item { width: 48px; height: 48px; }
body.portrait .inv-item img { width: 36px; height: 36px; }
body.portrait #side-buttons { flex-direction: row; align-items: center; justify-content: flex-end; }
body.portrait #side-buttons button { min-height: 40px; height: 40px; padding: 3px 5px; }
body.portrait #btn-switch { font-size: 15px !important; }
body.portrait #dialog-choices { bottom: 46vh; width: 94vw; }
body.portrait #dialog-choices button { font-size: 15px; padding: 10px; }

/* --- þjappað UI á lágum skjám (símar í landscape) --- */
@media (max-height: 520px) {
  #stage-wrap, #ui-bar { width: min(100vw, calc((100dvh - 78px) * 16 / 9)); }
  #ui-bar { padding: 2px 4px 4px; }
  #sentence-line { min-height: 15px; font-size: 12px; }
  #verbs { grid-template-columns: repeat(4, 70px); gap: 3px; }
  #verbs button {
    width: 70px; height: 22px; min-height: 22px; padding: 0; border: 0; background-size: 100% 100%;
  }
  .inv-item { width: 34px; height: 34px; }
  .inv-item img { width: 24px; height: 24px; }
  #side-buttons { flex-direction: row; align-items: center; }
  #side-buttons button { height: 29px; min-width: 30px; padding: 1px 3px;
    border-width: 4px; border-image-width: 4px; }
  #side-buttons button::before { width: 18px; height: 18px; flex-basis: 18px;
    background-size: 90px 18px; }
  #btn-switch { min-width: 66px !important; font-size: 12px !important; }
  #btn-hints::before { background-position: -18px 0; }
  #btn-journal::before { background-position: -36px 0; }
  #btn-pause::before { background-position: -54px 0; }
  #btn-full::before { background-position: -72px 0; }
  #dialog-choices { bottom: 90px; }
  #dialog-choices button { font-size: 13px; padding: 5px 8px; }
  .panel { max-height: 88vh; padding: 10px; }
}

/* --- titil-platan --- */
.title-plate { width: min(72%, 560px); max-height: 52%; object-fit: contain;
  image-rendering: pixelated; filter: drop-shadow(3px 4px 0 rgba(0,0,0,.55)); }
.title-plate-sm { width: min(52%, 420px); }
@media (max-height: 520px) {
  #title-card { gap: 6px; }
  #title-card h2 { font-size: 12px; }
  #title-card button { font-size: 13px !important; padding: 6px 16px !important; }
  .title-plate { max-height: 46%; }
  #title-card.title-screen { padding: 1.5% 2% 2%; }
  .title-screen .title-plate { width: min(43%, 430px); max-height: 42%; }
  .title-screen .title-menu { min-width: min(210px, 54%); }
  .title-screen .title-audio-gate { gap: 5px; }
  .title-screen .title-audio-gate span { padding: 6px 14px 5px; }
}
