:root {
  color-scheme: dark;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #02050b;
  color: #d8e1ed;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, #15213b 0, #070c17 40%, #02050b 75%),
    #02050b;
}

button { font: inherit; }

.lino-window {
  width: min(96vw, 1100px);
  height: min(92vh, 760px);
  min-width: 320px;
  min-height: 260px;
  display: grid;
  grid-template-rows: 34px 30px 1fr 28px;
  overflow: hidden;
  border: 1px solid #7890a8;
  border-radius: 7px 7px 2px 2px;
  background: #101927;
  box-shadow: 0 22px 80px #000c, inset 0 0 0 1px #b8c7d344;
}

.lino-window:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: 0;
  border-radius: 0;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 5px;
  background: linear-gradient(#9cb4c8, #5f7892 48%, #314b67 52%, #1d334b);
  color: #07111c;
  border-bottom: 1px solid #03070c;
  text-shadow: 0 1px #dbe7ef;
}

.app-mark {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #08131f;
  background: linear-gradient(135deg, #dce8f1, #728da5);
  font-family: Georgia, serif;
  font-weight: 900;
  box-shadow: inset 1px 1px #fff9;
}

.caption {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.caption span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  opacity: .78;
}

.window-buttons { margin-left: auto; }

.chrome-button,
.menubar button {
  color: #07111c;
  border: 1px solid #14283b;
  background: linear-gradient(#dbe6ee, #7d95aa);
  box-shadow: inset 1px 1px #fff, inset -1px -1px #3c5266;
  cursor: pointer;
}

.chrome-button {
  width: 27px;
  height: 25px;
  padding: 0;
  font-size: 19px;
  line-height: 1;
}

.chrome-button:hover,
.menubar button:hover { filter: brightness(1.16); }

.chrome-button:active,
.menubar button:active { transform: translateY(1px); }

.menubar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  background: linear-gradient(#263d55, #17283c);
  border-bottom: 1px solid #02060b;
}

.menubar button {
  height: 23px;
  padding: 1px 13px;
  font-size: 12px;
  font-weight: 800;
}

.runtime-badge {
  margin-left: auto;
  padding-right: 5px;
  color: #9eb7cc;
  font: 11px Consolas, monospace;
}

.menu-panel {
  position: absolute;
  top: 27px;
  left: 6px;
  width: 250px;
  padding: 10px;
  display: grid;
  gap: 5px;
  border: 1px solid #7f98ae;
  background: #d4e0e9;
  color: #0a1722;
  box-shadow: 5px 7px 0 #0008;
  font-size: 12px;
}

.menu-panel[hidden] { display: none; }

.menu-panel button {
  margin-top: 5px;
  padding: 5px 7px;
  border: 1px solid #263b50;
  background: linear-gradient(#f0f5f8, #9fb3c4);
  color: #08131e;
  cursor: pointer;
}

.viewport-shell {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
  background: #000;
}

#game {
  width: min(100%, calc((100vh - 116px) * 1.6));
  height: auto;
  max-height: 100%;
  aspect-ratio: 8 / 5;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  box-shadow: 0 0 0 1px #33465b, 0 0 42px #2c609033;
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background: repeating-linear-gradient(0deg, #0000 0 3px, #000 4px);
}

.exit-fullscreen {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  padding: 8px 12px;
  border: 1px solid #b4c8da;
  border-radius: 3px;
  background: #0b1725e8;
  color: #eef7ff;
  cursor: pointer;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 9px;
  overflow: hidden;
  border-top: 1px solid #637a90;
  background: linear-gradient(#263b50, #162639);
  color: #adc0d2;
  font: 11px Consolas, monospace;
}

.statusbar span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 540px) {
  .lino-window {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .caption span, .runtime-badge { display: none; }
  .viewport-shell { padding: 4px; }
}
