/*
 * 萌萌象棋 · 电脑 / 鼠标端样式（桌面增强层，华丽风格）
 * ============================================================
 * 只在宽屏 + 精确指针（鼠标）加载；手机/触摸屏走 styles-mobile.css。
 * 只做视觉增强，不改变棋盘尺寸计算依赖的 padding / gap / 边框宽度，
 * 避免 fitBoardSize() 算出的格子尺寸和实际布局不一致。
 *
 * index.html 加载顺序：styles.css（基础层）→ styles-desktop.css（本文件）→ styles-mobile.css；
 * 本文件用 media 限定只在桌面端生效，加载在基础层之后，匹配时覆盖同优先级的视觉规则。
 *
 * 主要变量：本层不新增也不读取 CSS 变量，颜色全部按桌面端写死成 rgba，
 * 只复用基础层的金色高光思路；动画关键帧统一放在文件末尾。
 */

/* 桌面端视觉增强：下面整块只在宽屏 + 鼠标指针匹配时生效。 */
@media (min-width: 761px) and (pointer: fine), (min-width: 1100px) {
  body {
    background:
      radial-gradient(1200px 760px at 12% -12%, rgba(88, 118, 168, 0.28), transparent 62%),
      radial-gradient(980px 680px at 104% 8%, rgba(146, 88, 44, 0.22), transparent 58%),
      radial-gradient(760px 520px at 50% 120%, rgba(70, 44, 90, 0.18), transparent 60%),
      repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 7px),
      linear-gradient(180deg, #0b1017 0%, #080a0e 100%);
  }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 50% 0%, rgba(216, 180, 106, 0.05), transparent 55%),
      linear-gradient(90deg, transparent 49.8%, rgba(216, 180, 106, 0.035) 50%, transparent 50.2%);
    z-index: 0;
  }

  /* 顶栏：渐变底、品牌呼吸光，抬高桌面端的质感。 */
  .topbar {
    padding: 6px 10px 0;
    background: linear-gradient(180deg, rgba(12, 16, 22, 0.86), rgba(12, 16, 22, 0));
  }
  .brand h1 {
    text-shadow: 0 2px 18px rgba(240, 213, 155, 0.24);
  }
  .brand-mark {
    border-color: rgba(240, 213, 155, 0.55);
    box-shadow:
      0 0 0 3px rgba(216, 180, 106, 0.1),
      0 8px 22px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: mmoe-brand-glow 5.5s ease-in-out infinite;
  }
  .brand .app-version {
    border-color: rgba(216, 180, 106, 0.28);
    background: rgba(216, 180, 106, 0.06);
  }

  /* 棋盘面板：更深的底板和更大的投影。 */
  .board-panel {
    border-color: rgba(216, 180, 106, 0.26);
    background:
      linear-gradient(180deg, rgba(34, 28, 20, 0.84), rgba(10, 13, 18, 0.94)),
      radial-gradient(900px 500px at 15% 0%, rgba(216, 180, 106, 0.08), transparent 60%);
    box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.62),
      0 0 0 1px rgba(240, 213, 155, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  /* 棋盘与格子：金色描边、悬停提亮、选中呼吸、棋子立体阴影。 */
  .board {
    box-shadow:
      inset 0 0 0 4px rgba(0, 0, 0, 0.28),
      inset 0 0 90px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(240, 213, 155, 0.22),
      0 28px 70px rgba(0, 0, 0, 0.48),
      0 0 42px rgba(216, 180, 106, 0.12);
  }
  .cell {
    transition: filter 0.15s ease, box-shadow 0.15s ease;
  }
  .cell:hover {
    filter: brightness(1.16) saturate(1.05);
    box-shadow: inset 0 0 0 1px rgba(240, 213, 155, 0.34), inset 0 0 20px rgba(240, 213, 155, 0.08);
    z-index: 3;
  }
  .cell.selected {
    box-shadow: inset 0 0 0 2px rgba(240, 213, 155, 0.72), inset 0 0 28px rgba(240, 213, 155, 0.2);
    animation: mmoe-selected-pulse 1.5s ease-in-out infinite;
  }
  .cell.last-to {
    box-shadow: inset 0 0 0 2px rgba(255, 159, 28, 0.5), inset 0 0 26px rgba(255, 159, 28, 0.16);
  }
  .cell.has-piece::before {
    box-shadow:
      0 4px 9px rgba(0, 0, 0, 0.62),
      0 0 12px rgba(255, 231, 190, 0.1),
      inset 0 0 0 2px rgba(63, 42, 18, 0.42),
      inset 0 0 0 4px rgba(255, 255, 255, 0.46),
      inset 0 -6px 9px rgba(0, 0, 0, 0.2);
  }
  .cell.has-piece:hover::before {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
      0 8px 16px rgba(0, 0, 0, 0.66),
      0 0 18px rgba(255, 231, 190, 0.18),
      inset 0 0 0 2px rgba(63, 42, 18, 0.55),
      inset 0 0 0 4px rgba(255, 255, 255, 0.55),
      inset 0 -6px 9px rgba(0, 0, 0, 0.2);
  }
  .cell.red.has-piece .glyph {
    text-shadow: 0 1px 0 rgba(255, 236, 216, 0.7), 0 0 10px rgba(255, 120, 90, 0.22);
  }
  .cell.blue.has-piece .glyph {
    text-shadow: 0 1px 0 rgba(232, 244, 255, 0.7), 0 0 10px rgba(120, 190, 255, 0.22);
  }

  /* 右侧按钮列：金属底、悬停抬升、按下回落。 */
  .game-rail .bar-right > * {
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  }
  .game-rail .start,
  .game-rail .invite,
  .game-rail .board-rotate,
  .game-rail .pass,
  .game-rail .endgame,
  .game-rail .score {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.12));
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.09);
  }
  .game-rail button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
      0 8px 18px rgba(0, 0, 0, 0.42),
      0 0 16px rgba(216, 180, 106, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .game-rail button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.4);
  }
  .game-rail .score.can-extend {
    animation: mmoe-score-ready 1.8s ease-in-out infinite;
  }

  /* 底部状态 / 结算行：金色渐变分隔，回合点呼吸。 */
  .board-status {
    border-top: 1px solid rgba(216, 180, 106, 0.14);
    background: linear-gradient(90deg, rgba(216, 180, 106, 0.05), rgba(216, 180, 106, 0));
  }
  .turn-dot {
    animation: mmoe-dot-breathe 2.4s ease-in-out infinite;
  }
  .turn-dot.idle { animation: none; }
  .result-line {
    border: 1px solid rgba(216, 180, 106, 0.2);
    background:
      linear-gradient(90deg, rgba(216, 180, 106, 0.09), rgba(216, 180, 106, 0.02)),
      rgba(10, 13, 18, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

/* 动画关键帧：品牌呼吸、选中脉冲、可加时提示、回合点呼吸。 */
@keyframes mmoe-brand-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.1), 0 8px 22px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(216, 180, 106, 0.06), 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 24px rgba(240, 213, 155, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
}
@keyframes mmoe-selected-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}
@keyframes mmoe-score-ready {
  0%, 100% { box-shadow: 0 0 0 2px rgba(216, 180, 106, 0.16), 0 0 14px rgba(216, 180, 106, 0.28); }
  50% { box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.26), 0 0 24px rgba(216, 180, 106, 0.5); }
}
@keyframes mmoe-dot-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}
