#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0, 0, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loading-text {
  color: #888;
  font-size: 13px;
  margin-top: 12px;
}

body {
  font-family:
    Noto Sans,
    system-ui,
    sans-serif;
  height: 100vh;
  background-image: url(./jinx-vi-arcane.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  margin: 0px;
  overflow: hidden;
}

#time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Passero One", sans-serif;
  font-size: clamp(5rem, 13vw, 11rem);
  color: #fff;
  padding: 0.1em;
  border-radius: 12px;
  pointer-events: none;
  z-index: -1;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
}

.closebutton {
  width: 16px;
  height: 16px;
  cursor: pointer;
  background-color: #ec6b5e;
  border-radius: 16px;
  border: solid 1px rgba(0, 0, 0, 0.25);
  margin-left: 6px;
}

.window {
  border: 1px solid rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  position: absolute;
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.125);
}

.windowheader {
  width: 100%;
  display: flex;
  align-items: center;
  cursor: grab;
  justify-content: space-between;
  margin-top: 8px;
}

.headertext {
  margin: 0px;
  color: #fff;
  font-weight: 500;
}

.selected {
  background-color: rgba(256, 256, 256, 0.25);
  border-radius: 16px;
}

#terminal-body {
  background: #1e1e1e;
  margin: 6px;
  border-radius: 12px;
  padding: 16px;
  font-family: "Courier New", monospace;
  color: #00ff00;
  width: 520px;
  height: 360px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#terminal-output {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
}

#terminal-output div {
  margin: 0;
}

#terminal-input-line {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

#terminal-prompt {
  color: #00ff00;
  margin-right: 8px;
  white-space: nowrap;
}

#terminal-input {
  background: transparent;
  border: none;
  color: #00ff00;
  font-family: "Courier New", monospace;
  font-size: inherit;
  outline: none;
  flex: 1;
  caret-color: #00ff00;
}

#code-body {
  background: #1e1e1e;
  margin: 6px;
  border-radius: 12px;
  width: 520px;
  height: 400px;
  overflow: hidden;
}

#context-menu {
  display: none;
  position: fixed;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 200px;
  backdrop-filter: blur(12px);
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#context-menu .context-item {
  padding: 8px 16px;
  color: #ccc;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

#context-menu .context-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#context-menu .context-item:active {
  background: rgba(255, 255, 255, 0.15);
}

#hotbar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  animation: hotbarFadeIn 0.2s ease;
}

#hotbar-overlay.open {
  display: flex;
}

@keyframes hotbarFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#hotbar {
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  max-width: 640px;
  width: 90%;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

#hotbar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.hotbar-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.hotbar-app:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hotbar-app:active {
  background: rgba(255, 255, 255, 0.15);
}

.hotbar-app img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  pointer-events: none;
}

.hotbar-app span {
  margin-top: 8px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}

#pixel-body {
  background: #1e1e1e;
  margin: 6px;
  border-radius: 12px;
  padding: 16px;
  width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#pixel-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

#pixel-sizes {
  display: flex;
  gap: 4px;
}

.pixel-size-btn {
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

.pixel-size-btn.active {
  background: #0a84ff;
  color: #fff;
  border-color: #0a84ff;
}

#pixel-palette {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pixel-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  box-sizing: border-box;
}

.pixel-swatch.active {
  border-color: #fff;
}

#pixel-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

#pixel-color-label {
  display: flex;
}

#pixel-color-picker {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: none;
}

#pixel-clear,
#pixel-export {
  background: #2a2a2a;
  color: #ddd;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

#pixel-clear:hover,
#pixel-export:hover {
  background: #3a3a3a;
}

#pixel-grid-container {
  background: #111;
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 540px;
}

#pixel-grid {
  display: grid;
  gap: 1px;
  user-select: none;
}

.pixel-cell {
  aspect-ratio: 1;
  background: #2a2a2a;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid #3a3a3a;
}

.pixel-cell:hover {
  opacity: 0.8;
}

#code-textarea {
  width: 100%;
  height: 100%;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: "Courier New", monospace;
  font-size: 14px;
  border: none;
  outline: none;
  padding: 16px;
  resize: none;
  tab-size: 2;
  line-height: 1.5;
  caret-color: #fff;
  box-sizing: border-box;
}
