/* 大千世界 —— 全屏银河观想 */

.cosmos-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #03040c;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s var(--ease-silk), visibility 0.9s;
}

.cosmos-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* 暗角，大师级收尾 */
.cosmos-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(2, 3, 10, 0.55) 100%),
    linear-gradient(180deg, rgba(2,3,10,0.35) 0%, transparent 18%, transparent 82%, rgba(2,3,10,0.45) 100%);
}

.cosmos-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.cosmos-canvas:active { cursor: grabbing; }

.cosmos-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.cosmos-title {
  position: absolute;
  top: 13vh;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 300;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: #f2eee6;
  text-shadow:
    0 0 22px rgba(150, 170, 255, 0.5),
    0 0 64px rgba(255, 190, 130, 0.3);
  animation: cosmos-breathe 7s ease-in-out infinite;
  transition: opacity 1.2s var(--ease-silk);
  white-space: nowrap;
}

.cosmos-sub {
  position: absolute;
  top: calc(13vh + clamp(3.4rem, 8vw, 6.2rem));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.88rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: rgba(242, 238, 230, 0.55);
  transition: opacity 1.2s var(--ease-silk);
  white-space: nowrap;
}

.cosmos-hint {
  position: absolute;
  bottom: 7vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: rgba(242, 238, 230, 0.38);
  transition: opacity 1.2s var(--ease-silk);
  white-space: nowrap;
}

.cosmos-ui.faded .cosmos-title,
.cosmos-ui.faded .cosmos-sub,
.cosmos-ui.faded .cosmos-hint {
  opacity: 0;
}

.cosmos-close {
  pointer-events: auto;
  position: absolute;
  bottom: 12vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 38px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: #f2eee6;
  background: rgba(242, 238, 230, 0.04);
  border: 1px solid rgba(242, 238, 230, 0.28);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.4s var(--ease-silk);
}

.cosmos-close:hover {
  border-color: rgba(255, 214, 160, 0.7);
  color: #ffd6a0;
  box-shadow: 0 0 26px rgba(255, 190, 130, 0.28);
}

@keyframes cosmos-breathe {
  0%, 100% { text-shadow: 0 0 22px rgba(150,170,255,0.5), 0 0 64px rgba(255,190,130,0.3); }
  50%      { text-shadow: 0 0 34px rgba(170,190,255,0.7), 0 0 90px rgba(255,190,130,0.45); }
}

@media (prefers-reduced-motion: reduce) {
  .cosmos-title { animation: none; }
}


/* ---- 我的世界方块游戏舱 (Minecraft舱) ---- */
.mc-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: rgba(3, 4, 12, 0.96);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mc-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ---- 设备选择层 ---- */
.mc-device-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 24px;
  text-align: center;
  animation: mc-fade-in 0.5s ease-out;
}

.mc-device-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 300;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: #f2eee6;
  text-shadow: 0 0 30px rgba(255, 190, 90, 0.3);
}

.mc-device-sub {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: rgba(242, 238, 230, 0.45);
}

.mc-device-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.mc-device-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.4s var(--ease-silk);
  min-width: 180px;
  backdrop-filter: blur(8px);
}

.mc-device-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 190, 90, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(255, 190, 90, 0.15);
}

.mc-device-btn.selected {
  background: rgba(255, 190, 90, 0.12);
  border-color: #ffbe5a;
  box-shadow: 0 0 32px rgba(255, 190, 90, 0.25);
}

.mc-device-btn.recommended {
  border-color: rgba(120, 180, 255, 0.5);
}

.mc-device-btn.recommended::after {
  content: '推荐';
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 2px 10px;
  font-size: 10px;
  background: linear-gradient(135deg, #78b4ff, #4a90d9);
  color: #fff;
  border-radius: 999px;
  letter-spacing: 0.1em;
}

.mc-device-icon {
  font-size: 2.5rem;
}

.mc-device-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: #f2eee6;
  letter-spacing: 0.15em;
}

.mc-device-desc {
  font-size: 0.75rem;
  color: rgba(242, 238, 230, 0.5);
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.mc-device-hint {
  font-size: 0.72rem;
  color: rgba(255, 190, 90, 0.5);
  letter-spacing: 0.1em;
  margin-top: 8px;
}

@keyframes mc-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- 游戏容器 ---- */
.mc-container {
  width: 100%;
  max-width: 1200px;
  height: 90vh;
  background: #0d0f1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.mc-container.mc-mobile {
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  border: none;
}

.mc-header {
  height: 52px;
  background: #080a12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.mc-tabs {
  display: flex;
  gap: 8px;
}

.mc-tab-btn {
  background: transparent;
  color: #8892b0;
  border: none;
  font-family: inherit;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.mc-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mc-tab-btn.active {
  color: #03040c;
  background: linear-gradient(135deg, #ffe9a8 0%, #ffbe5a 100%);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 190, 90, 0.25);
}

.mc-controls {
  display: flex;
  gap: 8px;
}

.mc-ctrl-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.mc-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mc-close-btn {
  background: linear-gradient(135deg, #c45a4a 0%, #8a251b 100%);
  border: none;
  color: #fff;
}

.mc-close-btn:hover {
  filter: brightness(1.1);
}

.mc-body {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

.mc-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.mc-loader {
  position: absolute;
  inset: 0;
  background: #07080f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffbe5a;
  font-size: 15px;
  z-index: 10;
  gap: 12px;
}

.mc-footer {
  height: 40px;
  background: #080a12;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  flex-shrink: 0;
}

.mc-tips {
  font-size: 12px;
  color: #8892b0;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ---- 移动端专属适配 ---- */
@media (max-width: 768px) {
  .mc-overlay {
    padding: 0;
    z-index: 3200;
  }

  .mc-device-select {
    padding: 24px 16px;
    gap: 20px;
  }

  .mc-device-grid {
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 320px;
  }

  .mc-device-btn {
    padding: 20px 24px;
    min-width: unset;
    width: 100%;
  }

  .mc-device-icon {
    font-size: 2rem;
  }

  .mc-device-name {
    font-size: 1rem;
  }

  .mc-container {
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    border: none;
  }

  .mc-header {
    height: 44px;
    padding: 0 10px;
  }

  .mc-tab-btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  .mc-ctrl-btn {
    font-size: 12px;
    padding: 5px 12px;
  }

  .mc-footer {
    height: 32px;
    padding: 0 10px;
  }

  .mc-tips {
    font-size: 11px;
  }

  .cosmos-title {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    letter-spacing: 0.3em;
    text-indent: 0.3em;
  }

  .cosmos-sub {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
  }

  .cosmos-hint {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    bottom: 5vh;
  }

  .cosmos-close {
    bottom: 10vh;
    padding: 9px 28px;
    font-size: 0.85rem;
  }
}

/* ---- 御剑千山 游戏舱 ---- */
.sf-overlay {
  position: fixed;
  inset: 0;
  z-index: 3150;
  background: #0a0e1c;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease-silk), visibility 0.7s;
}

.sf-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* HUD */
.sf-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  pointer-events: none;
  z-index: 3;
}

.sf-hud-left,
.sf-hud-right {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: #f2eee6;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.sf-hud-right {
  color: #8ef0d8;
}

.sf-hud-mid {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: rgba(255, 205, 130, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* 角标按钮 */
.sf-icon-btn {
  position: absolute;
  z-index: 4;
  padding: 8px 18px;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #f2eee6;
  background: rgba(10, 14, 28, 0.45);
  border: 1px solid rgba(242, 238, 230, 0.22);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s var(--ease-silk);
}

.sf-icon-btn:hover {
  border-color: rgba(255, 205, 130, 0.6);
  color: #ffcd82;
}

.sf-mute { top: 14px; right: 14px; font-size: 1rem; padding: 8px 14px; }
.sf-close { bottom: 18px; right: 16px; }

/* 面板 */
.sf-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 52px;
  background: rgba(10, 14, 28, 0.66);
  border: 1px solid rgba(255, 205, 130, 0.22);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  text-align: center;
  animation: sf-fade-in 0.6s ease-out;
  max-width: min(92vw, 460px);
}

@keyframes sf-fade-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.sf-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 7vw, 3rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #f2eee6;
  text-shadow: 0 0 26px rgba(255, 190, 110, 0.4);
}

.sf-sub {
  font-size: 0.85rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: rgba(242, 238, 230, 0.5);
}

.sf-tips {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 2;
  color: rgba(242, 238, 230, 0.82);
  letter-spacing: 0.12em;
}

.sf-tips2 {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 205, 130, 0.55);
}

.sf-btn {
  margin-top: 10px;
  padding: 13px 52px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: #0d1124;
  background: linear-gradient(135deg, #ffe9a8 0%, #ffbe5a 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 190, 90, 0.3);
  transition: all 0.35s var(--ease-silk);
}

.sf-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255, 190, 90, 0.45);
}

.sf-best {
  margin-top: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: rgba(242, 238, 230, 0.38);
}

.sf-over-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: #e8b4b8;
  text-shadow: 0 0 22px rgba(220, 120, 130, 0.4);
}

.sf-over-line {
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: rgba(242, 238, 230, 0.85);
}

.sf-over-total {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  letter-spacing: 0.2em;
  color: #ffcd82;
  text-shadow: 0 0 18px rgba(255, 190, 110, 0.4);
}

.sf-over-realm {
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: rgba(142, 240, 216, 0.8);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .sf-panel {
    padding: 30px 26px;
    gap: 11px;
  }
  .sf-hud {
    padding: 14px 16px;
  }
  .sf-hud-left,
  .sf-hud-right {
    font-size: 1rem;
  }
  .sf-hud-mid {
    font-size: 0.72rem;
  }
  .sf-close {
    bottom: 14px;
    right: 12px;
    padding: 7px 15px;
    font-size: 0.78rem;
  }
  .sf-mute {
    top: 52px;
    right: 12px;
  }
  .sf-tips {
    font-size: 0.88rem;
  }
  .sf-btn {
    padding: 12px 44px;
    font-size: 0.98rem;
  }
}


/* ===== 灵兔跃千山 Runner ===== */
.runner-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 12, 18, 0.97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.runner-overlay.open { opacity: 1; pointer-events: auto; }

.runner-container {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.runner-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: none; user-select: none; -webkit-user-select: none;
}

/* HUD */
.runner-hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px; z-index: 10;
  pointer-events: none;
  font-family: var(--font-main, sans-serif);
}
.runner-hud-left {
  display: flex; align-items: baseline; gap: 4px;
  color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.runner-dist { font-size: 28px; font-weight: 700; }
.runner-unit { font-size: 14px; opacity: 0.8; margin-left: 2px; }
.runner-realm {
  font-size: 13px; margin-left: 12px; padding: 2px 10px;
  background: rgba(255,255,255,0.15); border-radius: 12px;
  backdrop-filter: blur(4px);
}
.runner-hud-right {
  display: flex; align-items: center; gap: 6px;
  color: #60D0FF; text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.runner-coin-icon { font-size: 20px; }
.runner-coins { font-size: 22px; font-weight: 700; }

/* 菜单/结算面板 */
.runner-menu, .runner-over {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff;
  background: rgba(0,0,0,0.3);
}
.runner-menu h2 {
  font-size: 36px; font-weight: 700; margin-bottom: 8px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  letter-spacing: 6px;
}
.runner-sub {
  font-size: 16px; opacity: 0.85; margin-bottom: 24px;
  letter-spacing: 3px;
}
.runner-desc {
  font-size: 14px; line-height: 1.8; opacity: 0.7; margin-bottom: 32px;
}
.runner-btn {
  padding: 14px 48px; font-size: 18px; letter-spacing: 4px;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 32px;
  cursor: pointer; transition: all 0.25s;
  backdrop-filter: blur(8px);
  font-family: inherit;
}
.runner-btn:hover, .runner-btn:active {
  background: rgba(255,255,255,0.22);
  transform: scale(1.04);
  box-shadow: 0 4px 24px rgba(255,255,255,0.1);
}
.runner-best { font-size: 13px; opacity: 0.5; margin-top: 20px; }
.runner-total { font-size: 28px; font-weight: 700; margin: 12px 0 4px; }
.runner-over h3 {
  font-size: 32px; letter-spacing: 8px; margin-bottom: 8px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.runner-over p { font-size: 14px; opacity: 0.8; margin: 4px 0; }

/* 控制按钮 */
.runner-sound-btn, .runner-close-btn {
  position: absolute; z-index: 30;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 50%;
  width: 44px; height: 44px; font-size: 20px;
  cursor: pointer; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.runner-sound-btn { top: 16px; right: 16px; }
.runner-close-btn {
  bottom: 24px; left: 50%; transform: translateX(-50%);
  width: auto; height: auto; padding: 10px 32px;
  border-radius: 24px; font-size: 14px; letter-spacing: 3px;
}
.runner-sound-btn:hover, .runner-close-btn:hover { background: rgba(255,255,255,0.2); }

/* 移动端适配 */
@media (max-width: 768px) {
  .runner-overlay { padding: 0; }
  .runner-container { width: 100%; height: 100%; height: 100dvh; }
  .runner-menu h2 { font-size: 28px; letter-spacing: 4px; }
  .runner-sub { font-size: 14px; }
  .runner-desc { font-size: 13px; }
  .runner-btn { padding: 12px 40px; font-size: 16px; }
  .runner-hud { padding: 12px 14px; }
  .runner-dist { font-size: 24px; }
  .runner-coins { font-size: 18px; }
  .runner-close-btn { bottom: 16px; padding: 8px 24px; font-size: 13px; }
}
