/* ===== Base Page ===== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: #f2f2f2;
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  overflow: hidden;
  cursor: url("cursor.cur"), auto;
}

/* ===== Scroll Container ===== */
.screen {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  overflow-x: hidden;
  padding-left: 220px;
  padding-right: 202px;
  box-sizing: border-box;
}

/* ===== ASCII Area ===== */
.ansi-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.artboard {
  position: relative;
  width: max-content;
}

/* Real exported HTML art */
#text {
  position: relative;
  z-index: 1;
  display: block;
  width: max-content;
  margin: 0;
  white-space: pre;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  touch-action: none;
  pointer-events: auto;
  cursor: url("cursor.cur"), auto;
  will-change: auto;
}

/* Force stable monospace metrics for exported spans */
#text,
#text *,
#glitch-layer {
  white-space: pre !important;
  font-family: "Courier New", Courier, monospace !important;
  font-size: 6px !important;
  line-height: 6px !important;
  letter-spacing: 0 !important;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

/* Glitch overlay */
#glitch-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: block;
  width: max-content;
  margin: 0;
  color: #fff;
  background: transparent;
  pointer-events: none;
}

/* ===== Girl Textbox ===== */
.girl-textbox {
  position: absolute;
  left: 540px;
  top: 1270px;
  z-index: 10;
  pointer-events: auto;
}

.girl-textbox textarea {
  width: 220px;
  height: 120px;
  background: #fff;
  color: #000;
  border: 2px solid #7a7a7a;
  border-right-color: #f5f5f5;
  border-bottom-color: #f5f5f5;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 15px;
  padding: 6px;
  resize: none;
  box-sizing: border-box;
  pointer-events: none;
}

/* ===== Cursor Everywhere ===== */
body,
.screen,
#text,
#text *,
#glitch-layer,
pre,
.ie-window,
.ie-window * {
  cursor: url("cursor.cur"), auto;
}

a:hover {
  cursor: url("cursor.cur"), pointer;
}

/* ============================= */
/*     XP / MS PAINT THEME       */
/* ============================= */

.ie-window {
  position: fixed;
  top: 300px;
  left: 545px;
  margin: 0;
  width: 580px;
  max-width: none;
  z-index: 9999;
  background: #ECE9D8;
  border: 2px solid #7F9DB9;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  color: #000;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 12px;
  pointer-events: auto;
}

/* Title bars (XP blue) */
.ie-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: linear-gradient(#3A6EA5, #1E4F8A);
  color: #fff;
  cursor: move;
  user-select: none;
}

.ie-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ie-iconimg {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  display: inline-block;
}

.ie-icon {
  width: auto;
  height: auto;
  background: none;
  border: none;
  display: flex;
  align-items: center;
}

/* Window controls */
.ie-controls {
  display: flex;
  gap: 4px;
}

.ie-btn-win {
  width: 22px;
  height: 18px;
  background: #ECE9D8;
  border: 1px solid #4F6F8F;
  font-size: 12px;
  line-height: 16px;
  color: #000;
}

/* Bars */
.ie-menubar,
.ie-toolbar,
.ie-addressbar {
  display: flex;
  gap: 13px;
  padding: 3px 6px;
  background: #ECE9D8;
  border-bottom: 1px solid #C0C0C0;
  color: #000;
}

.ie-toolbar {
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
}

.ie-menubar u {
  text-decoration: underline;
}

.ie-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F7F7F7;
  border: 1px solid #7F9DB9;
  padding: 3px 6px;
  height: 22px;
  box-sizing: border-box;
}

.ie-sep {
  width: 1px;
  height: 22px;
  background: #7a7a7a;
  margin: 0 4px;
}

.ie-addressbar {
  gap: 8px;
  align-items: center;
}

.ie-address-label {
  min-width: 52px;
}

.ie-address-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #f5f5f5;
  border-bottom: 2px solid #f5f5f5;
  padding: 2px 6px;
  height: 22px;
  box-sizing: border-box;
}

.ie-pageicon {
  width: 14px;
  height: 14px;
  background: #0a3a9a;
  display: inline-block;
}

.ie-url {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ie-address-drop {
  margin-left: auto;
  width: 18px;
  height: 18px;
  background: #ECE9D8;
  border: 1px solid #7F9DB9;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.ie-address-go,
.ie-address-links {
  background: #F7F7F7;
  border: 1px solid #7F9DB9;
  padding: 3px 10px;
  height: 22px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

/* Main area */
.ie-main {
  display: grid;
  grid-template-columns: 150px 1fr;
  background: #fff;
  align-items: stretch;
}

.ie-leftpane {
  background: #F3F1E7;
  border-right: 1px solid #C0C0C0;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ie-link {
  display: block;
  background: #fff;
  border: 1px solid #B5B5B5;
  padding: 7px 7px;
  color: #0000ee;
  text-decoration: underline;
}

.ie-link:hover {
  background: #DDEBFF;
}

.ie-page {
  background: #fff;
  color: #000;
  padding: 14px;
  display: flex;
}

.ie-page-inner {
  box-sizing: border-box;
  width: 100%;
  flex: 1;
  border: 1px solid #C0C0C0;
  padding: 14px;
  position: relative;
  min-height: 260px;
  background: #fff;
  color: #000;
}

.ie-page-sub {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 6px;
}

.ie-page-title {
  font-weight: bold;
  font-size: 26px;
  margin-bottom: 10px;
}

.ie-page-text {
  font-size: 14px;
}

/* Piano gif in window */
.piano-gif-fixed {
  position: absolute;
  top: -3px;
  left: 310px;
  width: 75px;
  height: 50px;
  object-fit: fill;
  image-rendering: pixelated;
  z-index: 3;
  pointer-events: none;
}

/* UI VISUAL GLITCH FX */
@keyframes uiJitter {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(1px, 0); }
  50%  { transform: translate(-1px, 0); }
  75%  { transform: translate(0, 1px); }
  100% { transform: translate(0, 0); }
}

.ie-window.ui-glitch :is(
  .ie-titlebar span,
  .ie-page-sub,
  .ie-page-title,
  .ie-page-text
) {
  animation: uiJitter 120ms steps(2, end) infinite;
  text-shadow: 1px 0 0 rgba(255, 0, 0, 0.25), -1px 0 0 rgba(0, 255, 255, 0.25);
}

.ie-window.ui-glitch a,
.ie-window.ui-glitch img {
  animation: none !important;
  filter: none !important;
  text-shadow: none !important;
  transform: none !important;
}

/* ===== XP-ish AUDIO UI (TOP RIGHT) ===== */
#audio-ui {
  position: fixed;
  top: 10px;
  right: 26px;
  z-index: 10000;
  background: #ECE9D8;
  border: 2px solid #7F9DB9;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  color: #000;
}

#audio-ui button {
  width: 28px;
  height: 24px;
  background: linear-gradient(#FFFFFF, #D6D3C3);
  border: 1px solid #4F6F8F;
  box-shadow: inset 1px 1px 0 #fff;
  color: #000;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

#audio-ui button:active {
  box-shadow: inset -1px -1px 0 #fff;
  transform: translate(1px, 1px);
}

#audio-ui input[type="range"] {
  width: 140px;
  height: 18px;
  background: transparent;
  cursor: pointer;
}

/* Chrome/Edge */
#audio-ui input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #fff;
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #f5f5f5;
  border-bottom: 2px solid #f5f5f5;
}

#audio-ui input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 18px;
  margin-top: -8px;
  background: linear-gradient(#F7F7F7, #CFCBB8);
  border: 1px solid #4F6F8F;
  box-shadow: inset 1px 1px 0 #fff;
}

/* Firefox */
#audio-ui input[type="range"]::-moz-range-track {
  height: 6px;
  background: #fff;
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #f5f5f5;
  border-bottom: 2px solid #f5f5f5;
}

#audio-ui input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 18px;
  background: linear-gradient(#F7F7F7, #CFCBB8);
  border: 1px solid #4F6F8F;
  box-shadow: inset 1px 1px 0 #fff;
}

/* ===== View Counter ===== */
#viewCounterUI {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 10000;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

/* =========================
   OLD WINDOWS SCROLLBAR
   ========================= */

.screen::-webkit-scrollbar {
  width: 18px;
  background: #C0C0C0;
}

.screen::-webkit-scrollbar-track {
  background: #D4D0C8;
  border-left: 2px solid #808080;
  border-right: 2px solid #FFFFFF;
}

.screen::-webkit-scrollbar-thumb {
  background:
    linear-gradient(#808080, #808080) center 40% / 8px 1px no-repeat,
    linear-gradient(#808080, #808080) center 50% / 8px 1px no-repeat,
    linear-gradient(#808080, #808080) center 60% / 8px 1px no-repeat,
    #C0C0C0;
  border: 2px solid #808080;
  border-right-color: #FFFFFF;
  border-bottom-color: #FFFFFF;
  min-height: 40px;
}

.screen::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(#808080, #808080) center 40% / 8px 1px no-repeat,
    linear-gradient(#808080, #808080) center 50% / 8px 1px no-repeat,
    linear-gradient(#808080, #808080) center 60% / 8px 1px no-repeat,
    #B0B0B0;
}

.screen::-webkit-scrollbar-button {
  height: 18px;
  background: #C0C0C0;
  border: 2px solid #808080;
  border-right-color: #FFFFFF;
  border-bottom-color: #FFFFFF;
}

.screen::-webkit-scrollbar-button:vertical:decrement {
  background:
    linear-gradient(45deg, transparent 45%, black 46%, black 54%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, black 46%, black 54%, transparent 55%),
    #C0C0C0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 8px 8px;
}

.screen::-webkit-scrollbar-button:vertical:increment {
  background:
    linear-gradient(135deg, transparent 45%, black 46%, black 54%, transparent 55%),
    linear-gradient(-135deg, transparent 45%, black 46%, black 54%, transparent 55%),
    #C0C0C0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 8px 8px;
}

.screen {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  overflow-x: hidden;
  padding-left: 150px;
  padding-right: 202px;
  box-sizing: border-box;
}

.side {
  position: fixed;
  top: 0;
  height: 100vh;
  width: 150px;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side.left {
  left: 0;
}

.side.right {
  right: 18px;
  width: 170px;
}

.side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}