@font-face {
  font-family: 'C64 True';
  src: url('fonts/C64_True.ttf') format('truetype');
}

:root {
  --size: clamp(10px, 2vmin, 3vmin);
}
/* Färger och ramar kommer från ett tema (themes/*.css): --page, --bg, --fg, --edge. */

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--fg);
  font-family: 'C64 True', monospace;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen {
  position: absolute;
  width: 90vmin;
  height: 90vmin;
  background: var(--bg);
  border: var(--edge) solid var(--fg);
  box-sizing: border-box;
}

#splash {
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  display: flex;
  transition: transform 1s ease-out, opacity 0.3s ease;
  z-index: 2;
}

#splash.away { transform: translateY(-120%); }

#terminal {
  scrollbar-color: var(--fg) var(--bg);
  display: none;
  flex-direction: column;
  padding: 2vmin;
  overflow: auto;
  font-size: var(--size);
}

#terminal.on { display: flex; }

#header {
  text-align: center;
  white-space: pre;
  overflow: hidden;
}

#terminalText {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: var(--size);
}

#input-line {
  display: flex;
  font-size: var(--size);
}

#fakeInput { white-space: pre; display: contents; }

#cursor {
  display: inline-block;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

#commandInput {
  position: absolute;
  left: -9999px;
  background: var(--bg);
  color: var(--fg);
  border: none;
  outline: none;
  font-family: inherit;
  font-size: var(--size);
}

#egg {
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3;
  transition: transform 1s ease-in-out;
}

#egg.shown { display: flex; }
#egg.away { transform: translateY(-120%); }
#egg.instant { transition: none; }
#eggImage { max-width: 100%; max-height: 100%; }

#fileView {
  display: none;
  position: fixed;
  right: 2vmin;
  top: 50%;
  transform: translateY(-50%);
  width: 50vmin;
  height: 90vmin;
  box-sizing: border-box;
  padding: 1vmin;
  overflow-y: auto;
  white-space: pre-wrap;
  background: var(--bg);
  border: var(--edge) solid var(--fg);
  font-size: var(--size);
  z-index: 1;
}

#fileView.shown { display: block; }

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
