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

[hidden] {
  display: none !important;
}

.game-card {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: transparent;
  color: #2c3e50;
}

/* 外层容器透明：去掉外壳给 rounded-2xl 加的边框 */
.ot_workspace__inner .game-card {
  border: 0;
  box-shadow: none;
}

.page {
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---------- 顶部 ---------- */
.header__title {
  text-align: center;
  font-size: 26px;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.header__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field__label {
  font-size: 14px;
  color: #6b7a8f;
}

.field__select {
  padding: 6px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.btn {
  padding: 7px 14px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: #2c3e50;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #f0f4f9;
  border-color: #9fb2c8;
}

.btn:active {
  background: #e2e9f2;
}

.btn--primary {
  background: #0989E2;
  border-color: #0989E2;
  color: #fff;
}

.btn--primary:hover {
  background: #11719c;
  border-color: #11719c;
}

.btn--upload {
  display: inline-block;
}

.check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #6b7a8f;
  cursor: pointer;
}

/* ---------- 棋盘区域 ---------- */
.board-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
  font-size: 15px;
  color: #55677d;
}

.status__item b {
  color: #2c3e50;
  font-variant-numeric: tabular-nums;
}

.board {
  position: relative;
  width: min(86vmin, 760px);
  height: min(86vmin, 760px);
  border-radius: 10px;
  background: #fff; /* 空白块颜色 */
  box-shadow: 0 8px 24px rgba(34, 48, 63, 0.25);
  overflow: hidden;
  touch-action: none;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform 0.15s ease-out;
  will-change: transform;
  user-select: none;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.tile:hover {
  filter: brightness(1.08);
}

.tile__num {
  position: absolute;
  right: 4px;
  top: 4px;
  min-width: 20px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.board--no-num .tile__num {
  display: none;
}

/* ---------- 玩法说明 ---------- */
.help {
  margin: 24px 0 0;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  color: #55677d;
  font-size: 14px;
  line-height: 2;
}

.help__title {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.help__title i {
  color: #0989E2;
  margin-right: 6px;
}

.help ul {
  list-style: none;
}

.help li {
  padding-left: 14px;
  position: relative;
}

.help li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0989E2;
}

.help kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid #cfd8e3;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: #2c3e50;
}

/* ---------- 结算 ---------- */
.win-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 30, 40, 0.45);
  border-radius: 10px;
  animation: fade-in 0.3s ease-out;
}

.win-card {
  padding: 28px 40px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.win-card__title {
  font-size: 22px;
  margin-bottom: 10px;
}

.win-card__desc {
  font-size: 14px;
  color: #55677d;
  margin-bottom: 18px;
  line-height: 1.8;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- 原图预览 ---------- */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  animation: fade-in 0.15s ease-out;
  pointer-events: none; /* 不拦截指针，避免按住按钮时被遮罩抢走事件 */
}

.preview-overlay__img {
  max-width: 86vmin;
  max-height: 86vmin;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
