:root {
  --bg:          #06080f;
  --surface:     #0c1220;
  --surface2:    #111a2e;
  --surface3:    #182438;
  --cyan:        #00e5ff;
  --cyan-dim:    rgba(0, 229, 255, 0.35);
  --green:       #00ff88;
  --green-dim:   rgba(0, 255, 136, 0.35);
  --red:         #ff2244;
  --red-dim:     rgba(255, 34, 68, 0.35);
  --yellow:      #ffc107;
  --yellow-dim:  rgba(255, 193, 7, 0.35);
  --text:        #c8dce8;
  --text-dim:    #4a6680;
  --border:      rgba(0, 229, 255, 0.1);
  --border-h:    rgba(0, 229, 255, 0.4);

  --glow-cyan:   0 0 8px rgba(0, 229, 255, 0.55), 0 0 22px rgba(0, 229, 255, 0.2);
  --glow-green:  0 0 8px rgba(0, 255, 136, 0.55), 0 0 20px rgba(0, 255, 136, 0.2);
  --glow-red:    0 0 8px rgba(255, 34, 68, 0.55),  0 0 20px rgba(255, 34, 68, 0.2);

  --font-mono: 'Share Tech Mono', 'Fira Code', 'Courier New', monospace;
  --font-ui:   'Rajdhani', 'Segoe UI', system-ui, sans-serif;

  --radius: 4px;
  --transition: 0.14s ease;
}

/* GENERAL HTML TAGS
   ================================================== */

body {
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--text);
  background-color: var(--bg);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-weight: 900;
  padding: 0 5px;
  margin: 0;
  text-transform: uppercase;
  color: var(--cyan);
}

h1 {
  font-size: 31px;
  margin: 40px;
}

h2 {
  font-size: 18px;
  padding: 5px;
  border-bottom: 1px solid var(--border-h);
}

h3 {
  font-size: 20px;
  margin: 5px 0 0 0;
}

p {
  margin: 0;
}

a {
  text-decoration: none;
  font-weight: 700;
  color: inherit;
}

a:hover {
  text-decoration: underline;
}


/* JQUERY UI
   ================================================== */

.ui-widget-content {
  border: 1px solid var(--border-h);
  background: none;
  background-color: var(--surface);
}

/* ===[ JQuery UI dialogs ]=== */

.ui-dialog-titlebar {
  border: 0;
  background: none;
}

.ui-dialog-title {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 20px;
  color: var(--cyan);
}

.ui-dialog-content {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
}

/* ===[ JQuery UI buttons ]=== */

.ui-button.ui-state-default {
  background: none;
  background-color: var(--surface2);
  border-color: var(--border-h);
}

.ui-button.ui-state-hover {
  background-color: var(--surface3);
  border-color: var(--cyan);
}

.ui-button.ui-state-highlight {
  border-color: var(--yellow);
}

.ui-button .ui-button-text {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

/* ===[ JQuery UI accordion ]=== */

.ui-accordion .ui-accordion-header {
  border: 1px solid var(--border-h);
  margin-top: 5px;
  background-color: var(--surface2);
  background-image: none;
  padding-left: 20px;
}

.ui-accordion .ui-accordion-header a {
  font-family: var(--font-ui);
  font-weight: 900;
  color: var(--text);
  padding-left: 0;
  font-size: 14px;
}

.ui-accordion .ui-accordion-header.ui-state-active {
  border-color: var(--cyan);
  background-color: var(--surface3);
}

.ui-accordion .ui-accordion-header.ui-state-active a {
  color: var(--cyan);
}

.ui-accordion .ui-accordion-header.ui-state-hover:not(.ui-state-active) {
  border-color: var(--border-h);
  background-color: var(--surface3);
}

.ui-accordion .ui-accordion-header:first-child {
  margin-top: 0px;
}

.ui-accordion .ui-accordion-content {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 18px;
  border: 1px solid var(--border-h);
  border-top: 0px;
  margin-top: -3px;
  background-color: var(--surface);
  background-image: none;
  padding: 10px 20px;
  color: var(--text);
}

/* ===[ Additional JQuery icons (achievements and medals) ]=== */

.achievement {
  background-image: url('../img/achievement.png');
  width: 32px;
  height: 32px;
}

.medal {
  background-image: url('../img/medals.png');
  width: 32px;
  height: 32px;
}

.medal-gold {
  background-position: -32px 0;
}

.medal-silver {
  background-position: -64px 0;
}

.medal-bronze {
  background-position: -96px 0;
}

.flip {
  -moz-transform: scaleX(-1);
  -webkit-transform: scaleX(-1);
  -o-transform: scaleX(-1);
  transform: scaleX(-1);
  filter: fliph;
  /*IE*/
}

.ui-icon-close {
  cursor: pointer;
}

/* SCREENS
   ================================================== */

#lightbot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 980px;
  max-width: 100%;
  height: 740px;
  max-height: 100vh;
  margin-left: -490px;
  margin-top: -370px;
}

@media (max-width: 980px) {
  #lightbot {
    width: 100%;
    left: 0;
    margin-left: 0;
  }
}

@media (max-height: 740px) {
  #lightbot {
    height: 100vh;
    top: 0;
    margin-top: 0;
  }
}

#credits {
  font-size: 13px;
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 20px;
  text-align: center;
}

#credits2 {
  font-size: 13px;
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 100%;
  height: 16px;
  text-align: center;
}

.ui-screen {
  position: absolute;
  top: 20px;
  width: 100%;
  height: 700px;
  /* border: 1px solid #000; */
  /* background-color: #4b4646; */
}

#gameScreen {
  background: var(--bg);
}

/* WELCOME SCREEN
   ================================================== */

#welcomeScreen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

.hero-sphere {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 580px;
  height: 580px;
  opacity: 0.55;
  pointer-events: none;
}

.hero-sphere img {
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 80px;
  gap: 12px;
  width: 100%;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-ui);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding: 0;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-title span {
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.hero-sub {
  font-family: var(--font-ui);
  font-size: 20px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin: 4px 0 4px;
}

.hero-desc {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 420px;
  margin: 0 0 16px;
}

.levelSelectButton {
  cursor: pointer;
  font-size: 16px;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 40px;
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  background-color: var(--surface2);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transition: var(--transition);
}

.levelSelectButton:hover {
  background-color: var(--surface3);
  border-color: var(--cyan);
  padding: 14px 50px;
}

@media (max-width: 600px) {
  .hero-title { font-size: 48px; }
  .levelSelectButton { font-size: 14px; padding: 12px 28px; }
}


/* ACHIEVEMENTS SCREEN
   ================================================== */

#achievementsScreen h1 {
  color: var(--cyan);
}


#achievementsScreen .mainMenuButton {
  position: absolute;
  left: 40px;
  bottom: 40px;
}

#achievementsList {
  height: 513px;
  overflow: auto;
  padding: 0px;
  margin: 0px 40px;
  color: var(--text);
  list-style-type: none;
}

#achievementsList li {
  border: 1px solid var(--border-h);
  background-color: var(--surface2);
  height: 50px;
  margin-bottom: 5px;
}

#achievementsList li:hover {
  border-color: var(--cyan);
  background-color: var(--surface3);
}

#achievementsList li img {
  float: left;
  margin: 5px 15px 5px 5px;
}

/* LEVEL SELECT SCREEN
   ================================================== */

#levelSelectScreen h1 {
  color: var(--cyan);
}


#levelSelectScreen .mainMenuButton {
  position: absolute;
  left: 40px;
  bottom: 40px;
}

#levelSelectScreen ul {
  width: 700px;
  list-style-type: none;
  margin: 50px auto;
  padding: 0;
}

#levelSelectScreen li {
  margin: 5px 5px;
  padding: 1px;
  float: left;
  width: 120px;
  height: 90px;
  font-size: 4em;
  line-height: 2em;
  text-align: center;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border-h);
  background-color: var(--surface2);
  color: var(--text);
}

#levelSelectScreen li.ui-state-highlight {
  color: var(--cyan);
  background: none;
  border-color: var(--cyan);
  background-color: var(--surface3);
  box-shadow: var(--glow-cyan);
}

#levelSelectScreen li.ui-state-highlight.ui-state-hover {
  background: none;
  border-color: var(--cyan);
  background-color: var(--surface3);
}

#levelSelectScreen li.ui-state-hover:not(.ui-state-highlight) {
  background: none;
  border-color: var(--border-h);
  background-color: var(--surface3);
}

/* GAME SCREEN
   ================================================== */

#canvasContainer {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 690px;
  height: 666px;
  background-color: var(--bg);
}

#buttonContainer {
  position: absolute;
  left: 1px;
  bottom: 1px;
  width: 690px;
  height: 30px;
  background-color: var(--surface);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  box-sizing: border-box;
}

#buttonContainer button {
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  padding: 3px 14px;
  background-color: var(--surface2);
  color: var(--text-dim);
  border: 1px solid rgba(74, 102, 128, 0.4);
  border-radius: var(--radius);
  transition: var(--transition);
}

#buttonContainer button:hover {
  background-color: var(--surface3);
  color: var(--text);
  border-color: var(--text-dim);
}

#buttonContainer #runButton {
  color: var(--green);
  border-color: rgba(0, 255, 136, 0.4);
}

#buttonContainer #runButton:hover {
  border-color: var(--green);
  box-shadow: var(--glow-green);
}

#buttonContainer #clearButton {
  color: var(--red);
  border-color: rgba(255, 34, 68, 0.4);
}

#buttonContainer #clearButton:hover {
  border-color: var(--red);
  box-shadow: var(--glow-red);
}

/* ===[ Instruction Container ]=== */

#instructionsContainer {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 286px;
  height: 220px;
  background-color: var(--surface);
}

#instructionsContainer>div.ui-widget-content {
  overflow: auto;
  border: 0px;
}

#instructionsContainer li {
  cursor: move;
}

#instructionsContainer .ui-icon-close,
li.ui-draggable-dragging .ui-icon-close {
  display: none;
}

#instructionsContainer li div,
li.ui-draggable-dragging div,
#instructionsContainer li span:first-child+span {
  display: none;
}

/* ===[ Program Container ]=== */

#programContainer {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 286px;
  height: 476px;
  background-color: var(--surface);
}

#programContainer input[type="number"] {
  margin: 0px;
  padding: 0px;
  width: 40px;
  background-color: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
}

/* allows the droppable program container to show a scrollbar when the program fills up */
#programContainer>div {
  height: 442px;
  overflow: auto;
}

/* the droppable area should fill the entire programcontainer */
#programContainer>div>ul {
  min-height: 417px;
}

#programContainer li {
  cursor: move;
}

/* sortable helper */
#programContainer li.ui-state-highlight {
  height: 18px;
}

#programContainer>div.ui-widget-content {
  height: 438px;
  border: 0px;
  overflow: auto;
}

#instructionsContainer ul,
#programContainer ul {
  margin: 0em;
  list-style: none;
  padding: 5px;
}

#instructionsContainer ul.ui-droppable,
#programContainer ul.ui-droppable {
  padding-bottom: 20px;
}

#instructionsContainer li,
#programContainer li,
li.ui-draggable-dragging {
  list-style: none;
  border: 1px solid var(--border);
  margin: 0 0 2px 0;
  padding: 5px 5px;
  font-size: 11px;
  background: none;
  background-color: var(--surface2);
  border-color: var(--border-h);
}

#instructionsContainer li p,
#programContainer li p,
li.ui-draggable-dragging p {
  padding: 0px;
  margin: 0px;
  margin-bottom: 0.1em;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

#instructionsContainer li.ui-state-hover,
#programContainer li.ui-state-hover {
  background-color: var(--surface3);
  border-color: var(--cyan);
}

li.ui-draggable-dragging {
  width: 150px;
}

/* highlight droppable areas with a color */
.ui-state-droppable {
  background-color: var(--green-dim);
}

/* highlight the droppable area the mouse is currently hovering with another color */
.ui-state-droppable-hover {
  background-color: rgba(0, 255, 136, 0.55);
}

/* HELP SCREEN
   ================================================== */

#helpScreenAccordionContainer {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 400px;
}

#helpScreenVerticalBar {
  position: absolute;
  top: 0px;
  left: 466px;
  width: 42px;
  height: 700px;
  background: url('../img/helpscreen_vertical_bar.png');
}

#helpScreen .mainMenuButton {
  position: absolute;
  left: 40px;
  bottom: 40px;
}

#videoContainer {
  position: absolute;
  top: 175px;
  right: 40px;
  width: 400px;
}
