﻿@font-face {
  font-family: SuperMario256;
  src: url('../fonts/SuperMario256.ttf');
}

.start-screen {
  width: 1280px;
  height: 530px;
  margin: 0 auto;
  border: 1px solid black;
  background: url('../images/start-screen.png');
  position: relative;
}

.editor-screen {
  width: 1280px;
  height: 480px;
  margin: 0 auto;
  border: 1px solid black;
  background: url('../images/bg.png');
  position: relative;
  overflow: hidden;
  display: none;
}

.game-screen {
  width: 1280px;
  height: 480px;
  border: 1px solid black;
  border-top: none;
  background: url('../images/bg.png');
  display: none;
  margin: 0 auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.score-wrapper {
  padding-left: 40px;
  width: 1240px;
  margin: 0 auto;
  height: 50px;
  display: none;
  border: 1px solid black;
  border-bottom: none;
  line-height: 50px;
  font-size: 20px;
  background-color: #add1f3;
  font-family: SuperMario256;
  color: #ffffff;
}

.life-count {
  background: url('../images/mario-head.png') left center no-repeat;
  width: 100px;
  float: left;
  padding-left: 40px;
}

.life-count.tom-head {
  background: url('../images/mario-head-tom.png') left center no-repeat;
}

.coin-score {
  background: url('../images/coin.png') left center no-repeat;
  width: 150px;
  float: left;
  padding-left: 40px;
}

.level-num {
  width: 150px;
  float: left;
}

.total-score {
  float: left;
}
.cell {
  width: 31px;
  height: 31px;
  border: 1px solid blue;
}

.active {
  width: 31px;
  height: 31px;
  border: 1px solid blue;
  background: red;
  opacity: 0.5;
}

.element-wrapper {
  width: 1280px;
  height: 130px;
  background: #d2d2d2;
  margin: 0 auto;
  border: 1px solid black;
  display: none;
}

.platform {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') 0 0;
}

.coin-box {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -32px 0;
}

.power-up-box {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -64px 0;
}

.useless-box {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -96px 0;
}

.flag-pole {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -128px 0;
}

.flag {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -160px 0;
}

.pipe-left {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -192px 0;
}

.pipe-right {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -224px 0;
}

.pipe-top-left {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -256px 0;
}

.pipe-top-right {
  width: 31px;
  height: 31px;
  background: url('../images/elements.png') -288px 0;
}

.goomba {
  width: 31px;
  height: 31px;
  background: url('../images/enemies.png') 0 0;
}

.right-arrow {
  width: 60px;
  height: 60px;
  top: 215px;
  right: 0;
  background: url('../images/slider-right.png');
  position: absolute;
}

.left-arrow {
  width: 60px;
  height: 60px;
  top: 215px;
  left: 0;
  background: url('../images/slider-left.png');
  position: absolute;
}

.element-wrapper * {
  margin: 10px;
  float: left;
}

.lvl-size {
  clear: both;
  float: left;
  width: 115px;
  height: 32px;
  background: url('../images/lvl-size.png');
  margin-right: 10px;
}

.grid-small-btn {
  float: left;
  width: 64px;
  height: 32px;
  background: url('../images/grid-small-btn.png');
  border: none;
  margin-right: 10px;
}

.grid-medium-btn:selected {
  background: red;
}

.grid-medium-btn {
  float: left;
  width: 96px;
  height: 32px;
  background: url('../images/grid-medium-btn.png');
  border: none;
  margin-right: 10px;
}

.grid-large-btn {
  float: left;
  width: 128px;
  height: 32px;
  background: url('../images/grid-large-btn.png');
  border: none;
  margin-right: 10px;
}

.save-map-btn {
  float: right;
  width: 100px;
  height: 100px;
  background: url('../images/save-map-btn.png');
  border: none;
  border: 2px solid black;
  margin-right: 10px;
  margin-top: -35px;
}

.clear-map-btn {
  float: right;
  width: 100px;
  height: 100px;
  background: url('../images/clear-map-btn.png');
  border: none;
  border: 2px solid black;
  margin-right: 10px;
  margin-top: -35px;
}

.levels-wrapper {
  width: 1280px;
  height: 530px;
  margin: 0 auto;
  border: 1px solid black;
  position: relative;
  overflow: hidden;
  display: none;
  background: url('../images/bg.png');
}

.start-btn {
  width: 200px;
  height: 50px;
  color: #ffffff;
  background: #e74c3c;
  position: absolute;
  bottom: 30px;
  left: 252px;
  border: 2px solid black;
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  line-height: 46px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}

.editor-btn {
  width: 200px;
  height: 50px;
  background: #3498db;
  position: absolute;
  bottom: 30px;
  left: 530px;
  color: #ffffff;
  border: 2px solid black;
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  line-height: 46px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}

.created-btn {
  width: 200px;
  height: 50px;
  background: #2ecc71;
  position: absolute;
  bottom: 30px;
  left: 810px;
  color: #ffffff;
  border: 2px solid black;
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  line-height: 46px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}

.back-btn {
  width: 200px;
  height: 50px;
  background: url('../images/back-btn.png');
  color: #ffffff;
  border: 2px solid black;
  margin: 10px;
  display: none;
}

.level-btn {
  font-family: SuperMario256;
  font-size: 25px;
  float: left;
  line-height: 50px;
  text-align: center;
  width: 248px;
  height: 50px;
  color: #ffffff;
  border: 2px solid black;
  margin: 2px;
  text-transform: uppercase;
  font-weight: bold;
  background: #15a7d9;
}

.delete-all-btn {
  width: 100px;
  height: 100px;
  background: url('../images/delete-all-btn.png');
  color: #ffffff;
  border: 2px solid black;
  margin: 10px;
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.btn-wrapper {
  width: 1280px;
  height: 100px;
  margin: 0 auto;
}

.no-maps {
  width: 1000px;
  text-align: center;
  font-family: SuperMario256;
  font-size: 25px;
  margin: 0 auto;
  color: #ffffff;
  background: #5fb952;
  border: 2px solid black;
}

.loading-percentage {
  font-size: 60px;
  font-family: SuperMario256;
  text-align: center;
  padding: 100px;
}

.fb-comments {
  margin: 0 auto;
}


/* 全屏适配 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #14141f;
}

/* 角色选择 */
.char-select {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 60px;
  z-index: 10;
}

.char-card {
  width: 170px;
  height: 270px;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.char-card:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-4px);
}

.char-card.selected {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 0 20px rgba(255, 215, 0, 0.1);
  background: rgba(255, 255, 255, 0.22);
}

.char-card img {
  height: 205px;
  width: auto;
  max-width: 145px;
  object-fit: contain;
  pointer-events: none;
  image-rendering: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.char-name {
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-top: 6px;
  letter-spacing: 2px;
}


/* ============================================================
 * 排行榜相关样式（2026-11-24 新增）
 *
 * 三处 UI：
 *   1. 首页姓名输入框 .name-input（占原「关卡编辑器」位置）
 *   2. 首页排行榜按钮 .rank-btn（占原「我的关卡」位置）
 *   3. 答题排行面板 .lb-mask / .lb-card（挂在 .main-wrapper 内，
 *      跟着手机版的 rotate(90deg) 一起转，坐标不会被甩飞）
 * ============================================================ */

/* ---------- 首页姓名输入框 ---------- */
.name-input {
  width: 200px;
  height: 50px;
  position: absolute;
  bottom: 30px;
  left: 530px;
  box-sizing: border-box;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #1a1a1a;
  border-radius: 0;
  color: #222;
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  outline: none;
  z-index: 20;
  -webkit-appearance: none;
  appearance: none;
}

.name-input::placeholder {
  color: #9aa4b0;
  font-weight: normal;
  font-size: 18px;
}

.name-input:focus {
  border-color: #e74c3c;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35);
}

/* 名字为空时的抖动 + 红边提示 */
.name-input.name-input-error {
  border-color: #e74c3c;
  background: #ffecea;
  animation: nameShake 0.32s ease;
}

@keyframes nameShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ---------- 首页排行榜按钮（沿用原编辑器按钮的蓝色） ---------- */
.rank-btn {
  width: 200px;
  height: 50px;
  background: #3498db;
  position: absolute;
  bottom: 30px;
  left: 810px;
  color: #ffffff;
  border: 2px solid black;
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  line-height: 46px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 20;
  box-sizing: border-box;
}

.rank-btn:hover {
  background: #2f89c5;
}

/* 姓名没填时的提示气泡（挂在输入框上方） */
.name-hint {
  position: absolute;
  bottom: 88px;
  left: 530px;
  width: 200px;
  box-sizing: border-box;
  padding: 8px 10px;
  background: rgba(231, 76, 60, 0.95);
  color: #fff;
  font-family: 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.35;
  text-align: center;
  border: 2px solid #7f1d1d;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.name-hint.name-hint-show {
  opacity: 1;
}

/* ---------- 排行榜面板 ---------- */
.lb-mask {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;                 /* 用 flex 打开 */
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 20, 0.82);
  z-index: 9000;
  box-sizing: border-box;
  padding: 12px;
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
}

.lb-card {
  width: 760px;
  max-width: 96%;
  max-height: 100%;
  box-sizing: border-box;
  padding: 20px 26px 18px;
  background: linear-gradient(180deg, #14263f 0%, #0d1a2b 100%);
  border: 2px solid rgba(120, 190, 255, 0.45);
  border-radius: 14px;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.6);
  color: #e8f2ff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lb-title {
  font-size: 26px;
  font-weight: bold;
  text-align: center;
  color: #ffd77a;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.lb-sub {
  margin-top: 5px;
  font-size: 14px;
  text-align: center;
  color: #8fb0cc;
  letter-spacing: 0.5px;
}

.lb-list {
  margin-top: 14px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  border-top: 1px solid rgba(120, 170, 220, 0.22);
  border-bottom: 1px solid rgba(120, 170, 220, 0.22);
  padding: 6px 0;
}

.lb-empty {
  padding: 26px 18px;
  text-align: center;
  color: #7d97b3;
  font-size: 16px;
  line-height: 1.65;
}

/* 空状态/错误状态的多行引导 */
.lb-empty-main {
  font-size: 19px;
  font-weight: bold;
  color: #cfe3f7;
  margin-bottom: 10px;
}

.lb-empty-tip {
  font-size: 14px;
  color: #7d97b3;
  margin-top: 6px;
}

/* 关键的操作指引，用醒目色 */
.lb-empty-strong {
  color: #ffd77a;
  font-weight: bold;
  margin-top: 12px;
  word-break: break-all;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 18px;
  line-height: 1.3;
}

.lb-row + .lb-row {
  margin-top: 2px;
}

.lb-row-me {
  background: rgba(255, 196, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 80, 0.5);
}

.lb-rank {
  flex: 0 0 40px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  color: #0d1a2b;
  background: #5b7289;
  border-radius: 13px;
  margin-right: 12px;
}

.lb-rank-1 { background: #ffd24a; }
.lb-rank-2 { background: #cfd8e3; }
.lb-rank-3 { background: #d99a63; }

.lb-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eaf4ff;
}

.lb-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: #9ec9ef;
  letter-spacing: 0.5px;
}

.lb-my {
  margin-top: 12px;
  min-height: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #ffd77a;
  line-height: 1.4;
}

.lb-footer {
  min-height: 20px;
  text-align: center;
}

.lb-status {
  font-size: 13px;
  color: #7d97b3;
  line-height: 1.4;
}

.lb-status-warn {
  color: #ffb26b;
}

.lb-continue {
  margin: 12px auto 0;
  display: block;
  width: 220px;
  height: 48px;
  background: #e74c3c;
  color: #fff;
  border: 2px solid #7f1d1d;
  border-radius: 8px;
  font-family: inherit;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 2px;
}

.lb-continue:hover {
  background: #f0564a;
}

.lb-continue:active {
  transform: translateY(1px);
}


/* ============================================================
   素材加载遮罩（点「开始游戏」后显示，全部素材加载完才消失）
   —— 保证进游戏那一刻画面里所有图都在，不会出现方块/没人
   ============================================================ */
.asset-loader {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(10, 12, 22, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Microsoft YaHei', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.asset-loader .al-box {
  width: 520px;
  max-width: 82vw;
  text-align: center;
  color: #fff;
}

.asset-loader .al-title {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.asset-loader .al-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 22px;
}

.asset-loader .al-bar {
  height: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.asset-loader .al-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: linear-gradient(90deg, #ffd54a, #ffb300);
  transition: width 0.18s ease-out;
}

.asset-loader .al-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.85);
}

.asset-loader .al-pct {
  font-weight: bold;
  font-size: 20px;
  color: #ffd54a;
}

.asset-loader .al-hint {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  min-height: 18px;
  word-break: break-all;
  line-height: 1.5;
}

.asset-loader .al-retry {
  display: none;
  margin-top: 20px;
  padding: 10px 28px;
  font-size: 16px;
  font-family: inherit;
  color: #1a1a1a;
  background: #ffd54a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.asset-loader .al-retry.al-retry-show {
  display: inline-block;
}

.asset-loader .al-box.al-error .al-title {
  color: #ff8a80;
}

.asset-loader .al-box.al-error .al-fill {
  background: #ff5252;
}

/* ============================================================
   排行榜面板打开时：禁用虚拟按键层的点击
   —— 手机竖屏旋转模式下 #vb-layer 被设成 pointer-events:auto，
      整层透明地盖在画面上，会把面板按钮的点击全部吞掉
      （症状：点「继续闯关」完全没反应）。暂停时不需要按键，直接放行。
   ============================================================ */
body.lb-open #vb-layer,
body.lb-open #vb-layer .vb {
  pointer-events: none !important;
}
