* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0f0f1a;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Press Start 2P', monospace;
  overflow: hidden;
}

/* 像素鼠标 */
* { cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><polygon points="0,0 16,0 16,12 12,12 12,16 8,12 0,12" fill="%23c9a84c" stroke="%23000" stroke-width="1"/></svg>') 0 0, pointer; }

/* 桌面容器 */
.desktop {
  width: 640px;
  height: 480px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  position: relative;
  border: 3px solid #c9a84c;
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.3);
  overflow: hidden;
}

/* 网格背景 */
.desktop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* 顶部标题 */
.title {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  color: #c9a84c;
  font-size: 14px;
  text-shadow: 2px 2px 0 #8a7030;
  letter-spacing: 2px;
  z-index: 10;
}

/* 桌面图标 */
.icon {
  position: absolute;
  left: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.icon-folder {
  width: 48px;
  height: 40px;
  background: linear-gradient(180deg, #90e0ef 0%, #48cae4 100%);
  border: 2px solid #8a7030;
  border-radius: 2px 2px 0 0;
  position: relative;
}

.icon-folder::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  width: 20px;
  height: 8px;
  background: #90e0ef;
  border: 2px solid #8a7030;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.icon-folder::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: #16213e;
  border: 1px solid #8a7030;
}

.icon-label {
  color: #f1faee;
  font-size: 8px;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}

.icon:nth-child(1) { top: 50px; }
.icon:nth-child(2) { top: 130px; }

/* 主窗口 */
.window {
  position: absolute;
  top: 50px;
  left: 100px;
  width: 440px;
  height: 280px;
  background: #0d1b2a;
  border: 3px solid #c9a84c;
  box-shadow: 
    inset 2px 2px 0 #e8c86c,
    inset -2px -2px 0 #8a7030,
    4px 4px 0 rgba(0,0,0,0.5);
}

/* 标题栏 */
.window-titlebar {
  height: 28px;
  background: #1e3a5f;
  border-bottom: 2px solid #c9a84c;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
}

.window-btn {
  width: 14px;
  height: 14px;
  border: 2px solid;
}

.window-btn.close { background: #e63946; border-color: #000; }
.window-btn.min { background: #c9a84c; border-color: #000; }
.window-btn.max { background: #8a8a9a; border-color: #000; }

.window-title {
  margin-left: 10px;
  color: #c9a84c;
  font-size: 10px;
}

/* 窗口内容 */
.window-content {
  display: flex;
  height: calc(100% - 28px);
}

/* 两侧区域 */
.left-panel, .right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

/* 中间分隔线 */
.divider {
  width: 2px;
  background: linear-gradient(180deg, #e8c86c 0%, #8a7030 50%, #e8c86c 100%);
}

/* 按钮样式 */
.option-btn {
  width: 160px;
  height: 100px;
  background: #2a2a4a;
  border: 3px solid #8a7030;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s;
  user-select: none;
}

.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  transition: border-color 0.1s;
}

.option-btn:hover {
  background: #3a3a6a;
  transform: scale(1.05);
}

.option-btn:hover::before {
  border-color: #c9a84c;
}

.option-btn:active {
  transform: scale(0.98);
  background: #1a1a3a;
}

.option-btn .main-text {
  color: #c9a84c;
  font-size: 16px;
  text-shadow: 2px 2px 0 #000;
}

.option-btn .sub-text {
  color: #8a8a9a;
  font-size: 10px;
}

.option-btn .arrow {
  position: absolute;
  bottom: 8px;
  color: #8a7030;
  font-size: 12px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ========== 马里奥区域 ========== */
.mario-area {
  position: absolute;
  bottom: 50px;
  left: 100px;
  width: 440px;
  height: 120px;
}

/* 方块 */
.block {
  position: absolute;
  width: 40px;
  height: 40px;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  bottom: 65px;
}

.block-left {
  left: 50%;
  transform: translateX(-80px);
}

.block-right {
  right: 50%;
  transform: translateX(80px);
}

.block-inner {
  width: 100%;
  height: 100%;
  background: #2a2a4a;
  border: 3px solid #8a7030;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.block-inner::before {
  content: '?';
  color: #c9a84c;
  font-size: 16px;
  font-family: 'Press Start 2P', monospace;
}

.block.coin .block-inner {
  background: linear-gradient(135deg, #ffd60a 0%, #ffc300 100%);
  border-color: #c9a20a;
}

.block.coin .block-inner::before {
  content: '$';
  color: #8a7030;
}

.block.poison .block-inner {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
  border-color: #7b2cbf;
}

.block.poison .block-inner::before {
  content: '☠';
  color: #fff;
  font-size: 18px;
}

.block.pop {
  animation: blockPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes blockPop {
  0% { transform: translateX(-80px) scale(1); }
  30% { transform: translateX(-80px) scale(0.8) translateY(10px); }
  60% { transform: translateX(-80px) scale(1.3); }
  100% { transform: translateX(-80px) scale(1); }
}

.block-right.pop {
  animation: blockPopRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes blockPopRight {
  0% { transform: translateX(80px) scale(1); }
  30% { transform: translateX(80px) scale(0.8) translateY(10px); }
  60% { transform: translateX(80px) scale(1.3); }
  100% { transform: translateX(80px) scale(1); }
}

/* 马里奥 */
.mario {
  position: absolute;
  bottom: 5px;
  width: 48px;
  height: 56px;
  transition: left 0.05s linear;
  z-index: 10;
}

.mario-sprite {
  width: 100%;
  height: 100%;
  position: relative;
  image-rendering: pixelated;
  animation: walk 0.3s steps(2) infinite;
}

.mario:not(.walking) .mario-sprite {
  animation: none;
}

@keyframes walk {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.mario-body {
  position: absolute;
  width: 100%;
  height: 100%;
}

.mario-hat {
  position: absolute;
  top: 0;
  left: 8px;
  width: 32px;
  height: 10px;
  background: #e63946;
  border: 2px solid #b82e3a;
}

.mario-hat::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 12px;
  height: 8px;
  background: #e63946;
  border: 2px solid #b82e3a;
  border-radius: 50% 0 0 0;
}

.mario-face {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 18px;
  background: #ffdbac;
  border: 2px solid #e5c19e;
}

.mario-eye {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #222;
  top: 4px;
}

.mario-eye.left { left: 4px; }
.mario-eye.right { right: 4px; }

.mario-eye::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  top: 1px;
  left: 1px;
}

.mario-nose {
  position: absolute;
  top: 10px;
  left: 18px;
  width: 8px;
  height: 6px;
  background: #ffdbac;
  border: 1px solid #e5c19e;
}

.mario-beard {
  position: absolute;
  top: 18px;
  left: 8px;
  width: 32px;
  height: 6px;
  background: #6d4c41;
}

.mario-torso {
  position: absolute;
  top: 24px;
  left: 12px;
  width: 24px;
  height: 18px;
  background: #e63946;
  border: 2px solid #b82e3a;
}

.mario-strap {
  position: absolute;
  width: 4px;
  height: 12px;
  background: #457b9d;
  top: 4px;
}

.mario-strap.left { left: 4px; }
.mario-strap.right { right: 4px; }

.mario-pants {
  position: absolute;
  top: 42px;
  left: 12px;
  width: 24px;
  height: 8px;
  background: #1d3557;
  border: 2px solid #14213d;
}

.mario-shoe {
  position: absolute;
  bottom: 0;
  width: 14px;
  height: 10px;
  background: #6d4c41;
  border: 2px solid #5d3c31;
}

.mario-shoe.left { left: 8px; }
.mario-shoe.right { right: 8px; }

.mario.dead .mario-sprite {
  animation: none;
  transform: rotate(90deg) translateX(10px);
}

.mario.dead .mario-hat { background: #5d3c31; }
.mario.dead .mario-face { background: #e5c19e; }

/* ========== 任务栏 ========== */
.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: #16213e;
  border-top: 2px solid #c9a84c;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 20px;
}

.start-btn {
  background: #2a2a4a;
  border: 2px solid #c9a84c;
  padding: 4px 12px;
  color: #c9a84c;
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
}

.start-btn:hover {
  background: #3a3a6a;
}

.system-tray {
  margin-left: auto;
  color: #f1faee;
  font-size: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== 消息提示 ========== */
.message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(13, 27, 42, 0.95);
  border: 3px solid #c9a84c;
  padding: 15px 30px;
  color: #c77dff;
  font-size: 10px;
  font-family: 'Press Start 2P', monospace;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 100;
}

.message.show {
  opacity: 1;
}

/* 屏幕闪 */
.screen-flash {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
}

.screen-flash.active {
  animation: flash 0.8s;
}

@keyframes flash {
  0%, 30% { opacity: 1; }
  40%, 80% { opacity: 0; }
  100% { opacity: 1; }
}

/* 底部提示 */
.hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: #5a5a6a;
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
}
