:root{
  --bg:#000000;
  --frame:#b5a4f3;
  --frame-shadow:#c8bcfb;
  --screen:#4d35cb;
  --screen-dark:#432eb5;
  --text:#a9a5ff;
}

*{box-sizing:border-box}

body{
  margin:0;
  min-height:100vh;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  background:var(--bg);
  font-family:"C64 Pro Mono","Courier New",monospace;
  overflow-x:hidden;
}

#container{
  width:min(940px,100%);
  margin:0 auto;
  padding:0 12px 12px;
}

#status{display:none}

#page-header{
  display:block;
}

#page-title{
  color:#c8bcfb;
  font-family:"C64 Pro Mono","Courier New",monospace;
  font-weight:700;
  letter-spacing:1px;
  text-align:center;
}

footer{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  margin:18px 0 10px;
  color:#c8bcfb;
  font-family:"C64 Pro Mono","Courier New",monospace;
  font-size:12px;
  text-align:center;
}

footer a{
  color:#c8bcfb;
}

footer img{
  display:block;
  max-width:100%;
}

main{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:0;
}

#screen-area{
  width:100%;
  display:flex;
  justify-content:center;
  order:2;
  min-width:0;
}

#vic-screen{
  width:min(100%, 820px);
  margin:0 auto;
  padding:22px 24px;
  border-radius:30px;
  position:relative;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.10) 0,
      rgba(255,255,255,0.10) 1px,
      rgba(0,0,0,0.02) 2px,
      rgba(0,0,0,0.02) 4px
    ),
    linear-gradient(180deg,var(--frame-shadow),var(--frame));
}

.tv-frame{
  width:100%;
  padding:0;
  background:transparent;
}

#vic-canvas{
  display:block;
  width:100%;
  height:auto;
  image-rendering:pixelated;
  border:0;
  border-radius:0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.05) 0,
      rgba(255,255,255,0.05) 1px,
      rgba(0,0,0,0.03) 2px,
      rgba(0,0,0,0.03) 4px
    ),
    linear-gradient(180deg,var(--screen),var(--screen-dark));
}

#clock-controls{
  position:absolute;
  left:50%;
  bottom:38px;
  transform:translateX(-50%);
  display:none;
  z-index:3;
}

#btn-clock-color{
  padding:4px 10px;
  border:2px solid #d7cdff;
  background:#7562dd;
  color:#f4f1ff;
  font-family:"C64 Pro Mono","Courier New",monospace;
  font-size:11px;
  line-height:1.1;
  cursor:pointer;
  box-shadow:2px 2px 0 #4f429f;
}

#btn-clock-color:active{
  transform:translate(1px,1px);
  box-shadow:1px 1px 0 #4f429f;
}

#input-area{
  display:flex;
  justify-content:center;
  margin:10px 0 8px;
  order:1;
  width:100%;
}

.buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
}

.buttons button{
  padding:4px 10px;
  border:2px solid #b5a4f3;
  background:#2b2380;
  color:#d0c8ff;
  font-family:"C64 Pro Mono","Courier New",monospace;
  cursor:pointer;
  font-size:12px;
  line-height:1.1;
}

.buttons button:disabled{
  opacity:0.45;
  cursor:default;
}

@media (max-width: 900px){
  #container{
    padding:0 10px 12px;
  }

  #page-title{
    font-size:20px !important;
    margin:10px 0 8px !important;
  }

  #vic-screen{
    padding:18px 18px 20px;
    border-radius:24px;
  }
}

@media (max-width: 640px){
  #container{
    padding:0 8px 10px;
  }

  #page-title{
    font-size:16px !important;
    letter-spacing:0.5px;
  }

  #vic-screen{
    padding:14px 14px 18px;
    border-radius:18px;
  }

  #clock-controls{
    bottom:20px;
  }

  #btn-clock-color{
    padding:3px 8px;
    font-size:9px;
  }

  .buttons{
    gap:6px;
  }

  .buttons button{
    padding:4px 8px;
    font-size:10px;
  }

  footer{
    gap:10px;
    margin:14px 0 8px;
    font-size:10px;
  }

  footer img{
    max-width:150px;
    height:auto;
  }
}

@media (max-width: 480px){
  #page-title{
    font-size:13px !important;
    margin:8px 0 6px !important;
  }

  #vic-screen{
    padding:10px 10px 14px;
    border-radius:14px;
  }

  #clock-controls{
    bottom:14px;
  }

  #btn-clock-color{
    font-size:8px;
    border-width:1px;
    box-shadow:1px 1px 0 #4f429f;
  }

  .buttons button{
    font-size:9px;
    border-width:1px;
  }

  footer{
    font-size:9px;
  }

  footer img{
    max-width:130px;
  }
}
