body {
  margin: 0;
  background: #000;
}

button {
  font-family: 'Press Start 2P', 'Retro';
  cursor: pointer;
}

@font-face {
  font-family: 'Retro';
  src: url('retro.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#ui-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}

.ui-plane {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translate(0, 0);
}

.ui-screen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(60vw, 680px);
  height: min(60vw, 680px);
  transform: translate(-50%, -50%);

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(0, 0, 0, 0.92);
  border: 2px solid #FFB000;
  box-shadow: 0 0 12px currentColor;

  color: #FFB000;
  font-family: 'Press Start 2P', 'Retro';
  font-size: 14px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: auto;
}

.ui-screen-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 12px;
  box-sizing: border-box;
}

.ui-screen-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  font-family: 'Press Start 2P', 'Retro';
  font-size: 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ui-screen-close:hover {
  box-shadow: 0 0 8px currentColor;
}

.ui-panel-title {
  font-size: 10px;
  margin: 0 0 12px 0;
}

.ui-panel-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.resume-preview {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.resume-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.ui-panel-links {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-panel-link {
  color: inherit;
  text-decoration: none;
  border: 1px solid currentColor;
  padding: 6px 8px;
  display: inline-block;
}

.ui-panel-link:hover {
  background: currentColor;
  color: #b8acac56;
}

.slot-upper-left  { margin-left: -70.71vw; margin-top: -70.71vh; }
.slot-lower-left  { margin-left: -70.71vw; margin-top:  70.71vh; }
.slot-above       { margin-left:    0;    margin-top: -100vh; }
.slot-below       { margin-left:    0;    margin-top:  100vh; }
.slot-upper-right { margin-left:  70.71vw; margin-top: -70.71vh; }
.slot-lower-right { margin-left:  70.71vw; margin-top:  70.71vh; }

@media (max-width: 768px) {
  .ui-screen {
    width: min(70vw, 400px);
    height: min(70vw, 400px);
    font-size: 11px;
  }

  .ui-screen-close {
    width: 24px;
    height: 24px;
    font-size: 10px;
    top: 6px;
    right: 6px;
  }
  .slot-upper-left  { margin-left: -90vw; margin-top: -70.71vh; }
  .slot-lower-left  { margin-left: -90vw; margin-top:  70.71vh; }

  .slot-upper-right { margin-left:  90vw; margin-top: -70.71vh; }
  .slot-lower-right { margin-left:  90vw; margin-top:  70.71vh; }

   #color-fab {
    width: 42px;
    height: 42px;
  }

  .color-menu {
    min-width: 150px;
    bottom: 52px;
  }

  .color-btn {
    font-size: 8px;
  }
}

.color-fab-wrap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 40;
}

#color-fab {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.9);
  color: #FFB000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px currentColor;
  transition: color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#color-fab:hover {
  box-shadow: 0 0 12px currentColor;
}

#color-fab svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.color-menu {
  position: absolute;
  right: 0;
  bottom: 48px;
  min-width: 140px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.94);
  border: 1px solid currentColor;
  border-radius: 12px;
  color: #FFB000;
  box-shadow: 0 0 14px currentColor;
  transition: color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.color-menu.open {
  display: flex;
}

.color-btn {
  padding: 8px 10px;
  border-radius: 14px;
  font-family: 'Press Start 2P', 'Retro';
  font-size: 8px;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  text-align: center;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.color-btn:hover {
  box-shadow: 0 0 8px currentColor;
  cursor: pointer;
}

.color-btn.amber {
  color: #FFB000;
  border-color: #FFB00088;
}

.color-btn.green {
  color: #33FF33;
  border-color: #33FF3388;
}

.color-btn.custom {
  color: #cccccc;
  border-color: #ffffff44;
}

#color-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  overflow: hidden;
}