/* ============================================================
 * console.css — 掌机外壳视觉
 * 机身 / 屏幕边框 / D-pad / A-B 按钮 / 品牌标签 / 扬声器 / 布局
 * ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #cdc8c2;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.15), transparent 50%),
    linear-gradient(145deg, #d4cfc9, #b8b3ad);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #3a3633;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

/* ---- 掌机机身 ---- */
.console {
  width: 100%;
  max-width: 760px;
  border-radius: 40px;
  padding: 28px 30px 34px;
  background: linear-gradient(145deg, #b8b3ad, #8c8884);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.35),
    inset 0 -6px 12px rgba(0,0,0,0.22),
    0 24px 50px rgba(0,0,0,0.45),
    0 4px 8px rgba(0,0,0,0.25);
  position: relative;
}

/* 机身表面细微磨砂纹理 */
.console::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 40px;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
}

/* ---- 品牌标签 ---- */
.brand-label {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 5px;
  color: #5c5854;
  margin-bottom: 18px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3), 0 -1px 0 rgba(0,0,0,0.25);
}

/* ---- 顶部三栏布局 ---- */
.top-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: nowrap;
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pet-col { width: 168px; flex-shrink: 0; }
.hud-col { width: 132px; flex-shrink: 0; }

/* ---- 屏幕边框 bezel ---- */
.screen-bezel {
  background: linear-gradient(145deg, #3a3633, #2a2724);
  border-radius: 14px;
  padding: 10px;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,0.7),
    inset 0 -1px 2px rgba(255,255,255,0.05),
    0 1px 0 rgba(255,255,255,0.15);
}

.main-bezel { padding: 14px; }

.screen {
  background: #1a1a1d;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6);
}

.game-screen { width: 200px; height: 400px; }
.game-screen canvas { display: block; width: 200px; height: 400px; image-rendering: pixelated; }

.small-bezel { padding: 8px; border-radius: 12px; }
.pet-screen { width: 128px; height: 128px; position: relative; }
.pet-screen canvas { display: block; width: 128px; height: 128px; image-rendering: pixelated; }

.mini-bezel { padding: 6px; border-radius: 9px; }
.preview-screen { width: 96px; height: 96px; }
.preview-screen canvas { display: block; width: 96px; height: 96px; image-rendering: pixelated; }

/* ---- 下半部布局 ---- */
.bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  gap: 16px;
  padding: 0 8px;
}

/* ---- D-pad 十字键 ---- */
.dpad {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.dpad-btn {
  position: absolute;
  background: linear-gradient(145deg, #4a4642, #2a2724);
  border: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.12),
    inset 0 -2px 3px rgba(0,0,0,0.4),
    0 2px 3px rgba(0,0,0,0.4);
  transition: transform 0.06s, box-shadow 0.06s;
  touch-action: none;
}
.dpad-btn.active, .dpad-btn:active {
  transform: scale(0.92);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.dpad-up {
  top: 0; left: 40px;
  width: 40px; height: 44px;
  border-radius: 8px 8px 0 0;
}
.dpad-down {
  bottom: 0; left: 40px;
  width: 40px; height: 44px;
  border-radius: 0 0 8px 8px;
}
.dpad-left {
  left: 0; top: 40px;
  width: 44px; height: 40px;
  border-radius: 8px 0 0 8px;
}
.dpad-right {
  right: 0; top: 40px;
  width: 44px; height: 40px;
  border-radius: 0 8px 8px 0;
}

/* 方向小箭头 */
.dpad-up::after, .dpad-down::after, .dpad-left::after, .dpad-right::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  border: 6px solid transparent;
  transform: translate(-50%, -50%);
}
.dpad-up::after    { border-bottom-color: #b8b3ad; transform: translate(-50%, -75%); }
.dpad-down::after  { border-top-color: #b8b3ad; transform: translate(-50%, -25%); }
.dpad-left::after  { border-right-color: #b8b3ad; transform: translate(-75%, -50%); }
.dpad-right::after { border-left-color: #b8b3ad; transform: translate(-25%, -50%); }

.dpad-center {
  position: absolute;
  top: 40px; left: 40px;
  width: 40px; height: 40px;
  background: linear-gradient(145deg, #3a3633, #2a2724);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
}

/* ---- 中央装饰：扬声器 + 胶囊按钮 + 提示 ---- */
.center-deco {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.speakers {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  grid-template-rows: repeat(3, 6px);
  gap: 4px;
}
.speakers span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #5c5854;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.15);
}

.start-row { display: flex; gap: 10px; align-items: center; }

.pill-btn {
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f0ece6;
  background: linear-gradient(145deg, #6a6258, #4a443e);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.18),
    inset 0 -2px 3px rgba(0,0,0,0.4),
    0 2px 3px rgba(0,0,0,0.4);
  transition: transform 0.06s, box-shadow 0.06s;
  touch-action: none;
}
.pill-btn.start-btn { padding: 8px 18px; letter-spacing: 2px; }
.pill-btn.active, .pill-btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.hint {
  font-size: 10px;
  color: #6a6258;
  text-align: center;
  line-height: 1.5;
  letter-spacing: 0.3px;
  max-width: 220px;
}

/* ---- A/B 圆形按钮 ---- */
.ab-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  transform: rotate(-18deg);
}

.round-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  color: #2a2724;
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.4),
    inset 0 -3px 5px rgba(0,0,0,0.35),
    0 4px 6px rgba(0,0,0,0.4);
  transition: transform 0.06s, box-shadow 0.06s;
  touch-action: none;
}
.round-btn.a-btn { background: radial-gradient(circle at 35% 30%, #c89e94, #a87a70); }
.round-btn.b-btn { background: radial-gradient(circle at 35% 30%, #9499b3, #6d728f); }
.round-btn.active, .round-btn:active {
  transform: translateY(2px) scale(0.94);
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.5);
}

/* ---- 响应式：窄屏堆叠 ---- */
@media (max-width: 720px) {
  .console { border-radius: 28px; padding: 18px 14px 22px; }
  .top-row { flex-direction: column; align-items: center; }
  .pet-col, .hud-col { width: 100%; max-width: 320px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .hud-col { justify-content: space-between; }
  .main-bezel { align-self: center; }
  .bottom-row { flex-wrap: wrap; justify-content: center; gap: 18px; }
  .ab-buttons { transform: rotate(0); }
}
