* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  font-family: "Geneva", "Chicago", "Monaco", "Courier New", monospace !important;
}

body {
  background-color: #808080;
  background-image: 
    radial-gradient(#a0a0a0 20%, transparent 20%),
    radial-gradient(#3a3a3a 20%, transparent 20%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  color: #000;
  display: flex;
  flex-direction: column;
}

/* Top Mac Menu Bar */
.menu-bar {
  height: 24px;
  background: #fff;
  border-bottom: 2px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: bold;
  z-index: 99999;
  position: relative;
}

.menu-left, .menu-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-item {
  cursor: pointer;
  padding: 0 8px;
  height: 22px;
  display: flex;
  align-items: center;
  position: relative;
  color: #000;
  white-space: nowrap;
}

.menu-item:hover, .menu-item.open {
  background: #000;
  color: #fff;
}

/* System 7 Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 22px;
  left: 0;
  background: #fff !important;
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
  min-width: 240px;
  z-index: 100000;
  padding: 3px 0;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: normal;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #000 !important;
  background: #fff !important;
}

.dropdown-item:hover {
  background: #000 !important;
  color: #fff !important;
}

/* Desktop Workspace */
.desktop {
  flex: 1;
  position: relative;
  padding: 24px;
  overflow-x: auto;
  overflow-y: auto;
}

.desktop-grid {
  display: grid;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  gap: 28px 32px;
  width: max-content;
  z-index: 1;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 115px;
  cursor: pointer;
}

.icon-svg-box {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-svg-box svg {
  width: 48px !important;
  height: 48px !important;
}

.icon-title {
  font-size: 12px !important;
  font-weight: bold;
  background: #fff;
  padding: 2px 5px;
  border: 1px solid #000;
  text-align: center;
  max-width: 130px;
  white-space: pre-line; /* Støtter Sigrun Lindaas Norhagen over to linjer */
  overflow: hidden;
  color: #000;
  line-height: 1.2;
}

.icon.selected .icon-svg-box svg {
  filter: invert(100%);
}

.icon.selected .icon-title {
  background: #000;
  color: #fff;
}

/* Old School Mac Window Frame */
.mac-window {
  position: absolute;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 4px 4px 0px #000;
  display: flex;
  flex-direction: column;
  min-width: 400px;
}

.mac-window.closed {
  display: none;
}

.window-header {
  height: 24px;
  background: repeating-linear-gradient(
    0deg,
    #000,
    #000 1px,
    #fff 1px,
    #fff 2px
  );
  border-bottom: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  cursor: grab;
}

.window-header:active {
  cursor: grabbing;
}

.close-btn {
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid #000;
  cursor: pointer;
}

.close-btn:active {
  background: #000;
}

.window-title {
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  font-weight: bold;
}

.window-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

.retro-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: bold;
  border: 1px solid #000;
  padding: 3px 8px;
  background: #fff;
  text-transform: uppercase;
}

.retro-info-box {
  border: 1px solid #000;
  background: #f4f4f4;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
}

.retro-btn {
  background: #fff;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 1px 1px 0px #000;
  outline: 1px solid #000;
  outline-offset: -3px;
  text-decoration: none;
  color: #000;
  display: inline-block;
}

.retro-btn:active {
  background: #000;
  color: #fff;
}

.portal-frame {
  border: 2px solid #000;
  background: #111827;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-fallback {
  padding: 15px;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
}

.text-editor-body {
  padding: 16px;
  background: #fff;
  font-size: 12px;
  line-height: 1.6;
  color: #000;
  max-height: 400px;
  overflow-y: scroll;
  border: 1px solid #000;
}

.text-editor-body h1 {
  font-size: 15px;
  margin-bottom: 12px;
  text-decoration: underline;
  font-weight: bold;
}

.text-editor-body p {
  margin-bottom: 12px;
}

.guide-box {
  border: 1px dashed #000;
  background: #fafafa;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 12px;
}

/* 📱 MOBILTILPASSING */
@media (max-width: 600px) {
  .menu-bar {
    padding: 0 4px;
    font-size: 10px;
  }
  
  .menu-left, .menu-right {
    gap: 2px;
  }

  .menu-item {
    padding: 0 4px;
  }

  .desktop-grid {
    grid-template-rows: none;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: row;
    width: 100%;
    gap: 16px 8px;
  }

  .icon {
    width: 100%;
  }

  .icon-svg-box {
    width: 44px;
    height: 44px;
  }

  .icon-svg-box svg {
    width: 36px !important;
    height: 36px !important;
  }

  .icon-title {
    font-size: 11px !important;
  }

  .mac-window {
    width: 94vw !important;
    max-width: 360px !important;
    min-width: 280px !important;
    left: 50% !important;
    transform: translateX(-50%);
    top: 30px !important;
  }

  #win-om-sandkassen {
    width: 94vw !important;
    left: 50% !important;
    transform: translateX(-50%);
    top: 30px !important;
  }

  .portal-frame {
    height: 115px;
  }
}