@font-face {
  font-family: "WindowsRegular";
  src: url("fonts/Windows Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #a473ff url("icons/retro.jpg") no-repeat center center;
  background-size: cover;
  background-color: #a473ff;
  font-family: "WindowsRegular", Tahoma, Geneva, Verdana, sans-serif;
  color: #000;
  cursor: url("cursors/arrow.cur"), auto;
}

.home-screen-container {
  position: relative; 
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 100px;
}

.ios-top-bar {
  width: 100%;
  height: 40px;
  background: #f5edff;
  border-bottom: 2px solid #7f4bdd;
  box-shadow: 0 2px 0 #5f36a9;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}
.ios-top-bar-left {
  font-weight: bold;
  color: #7f4bdd;
}
.ios-top-bar-center {
  text-align: center;
  font-weight: bold;
  color: #7f4bdd;
}
.ios-top-bar-right {
  display: flex;
  align-items: center;
  gap: 5px;
}
#battery-percent {
  color: #7f4bdd;
}
.battery-icon {
  width: 20px;
  height: 20px;
}

/* Win98 error widget */
.win98-error-widget {
  width: 100%;
  background-color: #f5edff;
  border: 2px solid #7f4bdd;
  box-shadow: 3px 3px 0 #5f36a9;
}
.win98-error-titlebar {
  background: linear-gradient(90deg, #7f4bdd, #c2a0ff);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-weight: bold;
}
.win98-error-title {
  margin-left: 5px;
}
.win98-error-close {
  background: #fff;
  color: #7f4bdd;
  border: none;
  font-weight: bold;
  padding: 0 8px;
  cursor: default;
}
.win98-error-content {
  display: flex;
  align-items: center;
  padding: 20px;
}
.win98-error-icon {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}
.win98-error-content p {
  margin: 0;
  font-weight: bold;
  color: #000;
}

/* NEW: Talented box is absolutely positioned so it won't affect the app-grid */
.talented-box {
  position: absolute;
  left: 100px;  /* move it further left as desired */
  top: 200px;   /* adjust top so it doesn't overlap the error widget */
  width: 15%; /* adjust as needed for your image */
  background-color: #f5edff;
  border: 2px solid #7f4bdd;
  box-shadow: 3px 3px 0 #5f36a9;
  z-index: 1; /* keep it above the background */
}

.talented-box-titlebar {
  background: linear-gradient(90deg, #7f4bdd, #c2a0ff);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-weight: bold;
}
.talented-box-close {
  background: #fff;
  color: #7f4bdd;
  border: none;
  font-weight: bold;
  padding: 0 8px;
  cursor: default;
}
.talented-box-content {
  padding: 10px;
  text-align: center;
}
.talented-box-buttons {
  margin-top: 10px;
}
.talented-box-buttons button {
  background: #fff;
  color: #7f4bdd;
  border: 2px solid #7f4bdd;
  font-weight: bold;
  padding: 2px 8px;
  cursor: default;
  margin: 0 5px;
}

/* Hide on mobile screens */
@media (max-width: 768px) {
  .talented-box {
    display: none !important;
  }
}

/* App grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 100px;
  gap: 20px;
}
.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.app-icon img {
  width: 60px;
  height: 60px;
  background: #f5edff;
  border-radius: 0;
  border: 2px solid #7f4bdd;
  box-shadow: 2px 2px 0 #5f36a9;
  image-rendering: pixelated;
}
.app-icon span {
  margin-top: 5px;
  font-size: 0.9rem;
  color: #fff;
  text-align: center;
  font-weight: bold;
}
.app-icon:active img {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #5f36a9;
}
@media (hover: hover) {
  .app-icon:hover img {
    background-color: #c2a0ff;
    box-shadow: 2px 2px 0 #5f36a9, 0 0 6px #c2a0ff;
  }
}

/* Quick-access bar (mobile) */
.quick-access-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: #f5edff;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  z-index: 999;
  box-sizing: border-box;
}
.dock-icon img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 2px solid #7f4bdd;
  background: #f5edff;
  box-shadow: 2px 2px 0 #5f36a9;
  cursor: pointer;
}

/* Generic window styling */
.window {
  position: absolute;
  width: 300px;
  max-width: 90vw;
  background-color: #f5edff;
  border: 2px solid #7f4bdd;
  box-shadow: 3px 3px 0 #5f36a9;
  overflow: hidden;
  z-index: 1000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: fadeIn 0.5s ease-in-out;
}
.window-title-bar {
  background: linear-gradient(90deg, #7f4bdd, #c2a0ff);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-weight: bold;
}
.close-button {
  background: #fff;
  color: #7f4bdd;
  border: none;
  cursor: pointer;
  font-weight: bold;
  padding: 0 8px;
}
.window-content {
  padding: 10px;
}
.titlebar-icon {
  width: 32px;
  height: 32px;
  margin-right: 5px;
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Music player specifics */
.music-player-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.music-player-track-name {
  font-weight: bold;
  text-align: center;
}
.album-art {
  max-width: 120px;
  border: 2px solid #7f4bdd;
  box-shadow: 3px 3px 0 #5f36a9;
  margin-bottom: 5px;
}
.music-player-progress-bar {
  position: relative;
  width: 80%;
  height: 10px;
  background: #ccc;
  border: 2px solid #7f4bdd;
  margin: 5px 0;
}
.music-player-progress {
  width: 0%;
  height: 100%;
  background: #7f4bdd;
}
.music-player-timestamp {
  font-size: 0.8rem;
  color: #333;
  text-align: center;
  margin-bottom: 5px;
}
.music-player-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
}
.music-player-controls button {
  background: #f5edff;
  border: 2px solid #7f4bdd;
  padding: 5px 10px;
  font-weight: bold;
  color: #7f4bdd;
  cursor: pointer;
  margin: 0 2px;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.music-player-controls button:hover {
  background: #c2a0ff;
  color: #fff;
}

/* Notepad specifics */
.notepad-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 300px;
}
.notepad-menu-bar {
  background: #eee;
  border-bottom: 1px solid #ccc;
  padding: 4px 8px;
}
.notepad-menu-bar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}
.notepad-menu-bar li {
  cursor: pointer;
  font-weight: bold;
  color: #333;
}
.notepad-menu-bar li:hover {
  background: #c2a0ff;
  color: #fff;
}
.notepad-content textarea {
  flex: 1;
  width: 100%;
  padding: 8px;
  border: none;
  resize: none;
  outline: none;
  font-family: "WindowsRegular", Tahoma, monospace;
  font-size: 14px;
  background: #fff;
  color: #000;
  box-sizing: border-box;
}

/* Camera window specifics */
.camera-window {
  width: 300px;
  height: 300px;
  box-shadow: none;
  border: 2px solid #7f4bdd;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background-color: #f5edff;
  animation: fadeIn 0.5s ease-in-out;
  z-index: 1000;
}

.camera-content {
  width: 100%;
  height: 90%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.photo-grid {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  box-sizing: border-box;
  padding: 5px;
}
.photo-tile {
  perspective: 1000px;
  position: relative;
  cursor: pointer;
  border: none;
  width: 100%;
  height: 100%;
}
.photo-tile-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  position: relative;
}
.photo-tile.flipped .photo-tile-inner {
  transform: rotateY(180deg);
}
.photo-tile-front,
.photo-tile-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  box-sizing: border-box;
  border: 2px solid #7f4bdd;
  box-shadow: 2px 2px 0 #5f36a9;
}
.photo-tile-front {
  background: #ffd7f2;
}
.photo-tile-back {
  transform: rotateY(180deg);
  background-size: cover;
  background-position: center;
}

/* Paint window specifics */
.paint-window {
  width: 500px;
  height: 400px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #f5edff;
  border: 2px solid #7f4bdd;
  box-shadow: 3px 3px 0 #5f36a9;
  z-index: 1000;
  animation: fadeIn 0.5s ease-in-out;
}
.paint-content {
  width: 100%;
  height: calc(100% - 30px);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.paint-toolbar {
  display: flex;
  gap: 10px;
  padding: 5px;
  background: #eee;
  border-bottom: 1px solid #ccc;
}
#paint-canvas {
  flex: 1;
  width: 100%;
  background: #fff;
  cursor: crosshair;
  display: block;
}
@media screen and (max-width: 768px) {
  .paint-icon {
    display: none !important;
  }
  .spaceship-icon {
    display: none !important;
  }
}

/* Win98 taskbar */
.win98-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: #f5edff;
  border-top: 2px solid #7f4bdd;
  display: none;
  align-items: center;
  padding: 0 10px;
  z-index: 999;
  box-sizing: border-box;
}
.start-button {
  background: #f5edff;
  border: 2px solid #7f4bdd;
  color: #7f4bdd;
  font-weight: bold;
  padding: 5px 10px;
  margin-right: 10px;
  cursor: pointer;
}
.task-tabs {
  display: flex;
  gap: 5px;
}
.task-tab {
  background: #f5edff;
  border: 2px solid #7f4bdd;
  color: #7f4bdd;
  padding: 5px 10px;
  font-weight: bold;
  cursor: pointer;
}
.task-tab:hover {
  background: #c2a0ff;
  color: #fff;
}
.start-menu {
  position: fixed;
  bottom: 40px;
  left: 0;
  width: 150px;
  background: #f5edff;
  border: 2px solid #7f4bdd;
  box-shadow: 3px 3px 0 #5f36a9;
  display: none;
  z-index: 1000;
}
.start-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.start-menu li {
  padding: 5px 10px;
  border-bottom: 1px solid #7f4bdd;
  cursor: pointer;
  font-weight: bold;
  color: #7f4bdd;
}
.start-menu li:hover {
  background: #c2a0ff;
  color: #fff;
}
@media (min-width: 769px) {
  .quick-access-bar {
    display: none !important;
  }
  .win98-taskbar {
    display: flex !important;
  }
}
.task-tab.active {
  background: #c2a0ff;
  color: #fff;
}

/* Polybius content */
.polybius-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.polybius-content textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: "WindowsRegular", Tahoma, monospace;
  border: 2px solid #7f4bdd;
  padding: 5px;
  resize: none;
}
.polybius-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.polybius-controls button {
  background: #f5edff;
  border: 2px solid #7f4bdd;
  padding: 5px 10px;
  font-weight: bold;
  color: #7f4bdd;
  cursor: pointer;
}
.polybius-controls button:hover {
  background: #c2a0ff;
  color: #fff;
}
@media (max-width: 768px) {
  html, body {
    overflow: hidden;
    height: 100%;
  }
}