html, body {
  margin: 0; padding: 0;
  width: 100vw; height: 100vh;
  background-color: #008080 !important;
  background-image: linear-gradient(to bottom, #010a26 0%, #ff71ce 50%, #01cdfe 100%) !important;
  font-family: 'MS UI Gothic', "ＭＳ Ｐゴシック", sans-serif;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.sun {
  position: absolute; top: 10%; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px; border-radius: 50%;
  background: linear-gradient(to bottom, #ffeb3b 0%, #ff007c 100%);
  box-shadow: 0 0 50px #ff007c;
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0%, #000 8%, transparent 8%, transparent 10%);
  mask-image: repeating-linear-gradient(to bottom, #000 0%, #000 8%, transparent 8%, transparent 10%);
  z-index: 1;
}

/* ★ 修正: PCで床が見切れないように、コンテナの高さと配置を調整 ★ */
.grid-container {
  position: absolute; 
  bottom: 35px; /* タスクバーの高さ */
  left: 0; 
  right: 0; 
  height: 50vh; /* PCでも十分に見えるように高さを確保 */
  perspective: 400px; 
  overflow: hidden; 
  z-index: 2;
}
.grid {
  position: absolute; 
  top: 0; 
  left: -100vw; /* 左右にはみ出させて画面幅カバー */
  right: -100vw; 
  height: 200%; /* 床を奥まで伸ばす */
  background-image: linear-gradient(#ff71ce 2px, transparent 2px), linear-gradient(90deg, #01cdfe 2px, transparent 2px);
  background-size: 40px 40px; 
  transform: rotateX(75deg); /* 奥に寝かせる角度を調整 */
  transform-origin: top center;
  animation: gridMove 2s linear infinite; 
  background-color: rgba(0, 0, 0, 0.85);
}
@keyframes gridMove {
  0% { transform: rotateX(75deg) translateY(0); }
  100% { transform: rotateX(75deg) translateY(40px); }
}

.neon-palm {
  position: absolute;
  bottom: 35px;
  height: 65vh;
  max-width: 40vw;
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 0 15px #ff71ce) drop-shadow(0 0 5px #01cdfe);
}
.palm-left { left: 0; }
.palm-right { right: 0; transform: scaleX(-1); }

.aframe-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
}

/* デスクトップアイコン */
.desktop-icons {
  position: absolute; top: 20px; left: 20px;
  display: flex; flex-direction: column; gap: 25px; z-index: 5;
}
.icon {
  display: flex; flex-direction: column; align-items: center; width: 75px; cursor: pointer;
  /* アイコンがクリッカブルであることを明確にする */
  pointer-events: auto;
}
.icon img {
  width: 32px; height: 32px; margin-bottom: 5px; image-rendering: pixelated;
}
.icon span {
  color: white; font-size: 12px; text-align: center; padding: 2px 4px; border: 1px dotted transparent; text-shadow: 1px 1px 0 #000;
}
.icon:hover span, .icon:active span {
  background: #000080; border: 1px dotted #fff; text-shadow: none;
}

.window {
  position: absolute;
  background: #c0c0c0;
  border-top: 2px solid #dfdfdf; border-left: 2px solid #dfdfdf;
  border-right: 2px solid #000; border-bottom: 2px solid #000;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #fff, 4px 4px 0px rgba(0,0,0,0.5);
  z-index: 10; color: #000; box-sizing: border-box;
}

.title-bar {
  background: linear-gradient(to right, #000080, #1084d0); color: white;
  padding: 3px 5px; margin: 2px 2px 0 2px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: bold; font-size: 14px; cursor: grab;
}
.title-bar:active { cursor: grabbing; }

.close-btn { 
  background: #c0c0c0; color: black; padding: 1px 5px; 
  border-top: 2px solid #dfdfdf; border-left: 2px solid #dfdfdf;
  border-right: 2px solid #000; border-bottom: 2px solid #000;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #fff;
  cursor: pointer; font-size: 12px; font-weight: bold; font-family: sans-serif;
}
.close-btn:active {
  border-top: 2px solid #000; border-left: 2px solid #000;
  border-right: 2px solid #dfdfdf; border-bottom: 2px solid #dfdfdf;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
}

.window-body { padding: 10px; background: #c0c0c0; }

.tabs {
  display: flex; margin: 0; padding: 0 5px; position: relative; z-index: 1;
}
.tab {
  background: #c0c0c0;
  border-top: 2px solid #dfdfdf; border-left: 2px solid #dfdfdf;
  border-right: 2px solid #000; border-bottom: 2px solid #c0c0c0;
  box-shadow: inset -1px 0 #808080, inset 1px 1px #fff;
  padding: 4px 12px; margin-right: 2px; cursor: pointer;
  font-family: 'MS UI Gothic', sans-serif; font-size: 13px; color: #000;
}
.tab.active {
  padding-bottom: 6px; margin-top: -2px; font-weight: bold; z-index: 3;
}
.tab-content {
  border-top: 2px solid #dfdfdf; border-left: 2px solid #dfdfdf;
  border-right: 2px solid #000; border-bottom: 2px solid #000;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #fff;
  padding: 15px; background: #c0c0c0; position: relative; z-index: 2; margin-top: -2px; text-align: center;
}

.main-window {
  top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 400px;
}
.error-window { width: 80%; max-width: 250px; }
.error-1 { top: 10%; left: 20%; }
.error-2 { bottom: 15%; right: 5%; }

.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 35px;
  background: #c0c0c0; border-top: 2px solid #dfdfdf;
  display: flex; align-items: center; justify-content: space-between; padding: 0 4px; z-index: 1000; color: #000;
}
.start-btn {
  background: #c0c0c0;
  border-top: 2px solid #dfdfdf; border-left: 2px solid #dfdfdf;
  border-right: 2px solid #000; border-bottom: 2px solid #000;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #fff;
  font-weight: bold; padding: 4px 8px; display: flex; align-items: center; cursor: pointer; font-family: 'MS UI Gothic', sans-serif;
}
.start-btn img { width: 16px; height: 16px; margin-right: 4px; image-rendering: pixelated; }
.start-btn:active {
  border-top: 2px solid #000; border-left: 2px solid #000;
  border-right: 2px solid #dfdfdf; border-bottom: 2px solid #dfdfdf;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
}
.tray {
  border-top: 2px solid #808080; border-left: 2px solid #808080;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  padding: 4px 10px; font-size: 12px; display: flex; align-items: center; gap: 10px; font-family: sans-serif;
}

.btn {
  display: inline-block; padding: 4px 15px; margin-top: 5px;
  background: #c0c0c0; border-top: 2px solid #dfdfdf; border-left: 2px solid #dfdfdf;
  border-right: 2px solid #000; border-bottom: 2px solid #000;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #fff;
  color: black; text-decoration: none; font-weight: bold; cursor: pointer; font-size: 14px; font-family: 'MS UI Gothic', sans-serif;
}
.btn:active {
  border-top: 2px solid #000; border-left: 2px solid #000;
  border-right: 2px solid #dfdfdf; border-bottom: 2px solid #dfdfdf;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
}
.return-btn { width: 100%; box-sizing: border-box; }
.player {
  margin: 10px 0; padding: 10px; border: 2px inset #808080; background: #000; color: #05ffa1; font-family: 'Courier New', monospace; font-weight: bold; font-size: 12px;
}
.glitch { 
  font-size: 2em; color: #01cdfe; text-shadow: 2px 2px 0px #ff71ce; margin: 0 0 10px 0; font-family: "ＭＳ Ｐ明朝", serif; letter-spacing: 2px;
}
.vhs-glitch { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(transparent, transparent 2px, rgba(0,0,0,0.1) 3px); pointer-events: none; z-index: 99; }
.scanlines { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06)); background-size: 100% 4px, 4px 100%; pointer-events: none; z-index: 98; }
