/* ============================================================
   棋牌学院 HTML原型 公共样式
   口径：全App统一横屏（UI定2+挂账2销账）；
   视觉：清爽教育感，深色牌桌打底，不搞土味金币光效（UI文档第六章）
   ============================================================ */

:root {
  /* 主色盘：深色打底 + 教育感青绿点缀 */
  --bg-deep: #0f1b2d;        /* 全局深底 */
  --bg-panel: #16263c;       /* 面板底 */
  --bg-card: #1d3149;        /* 卡片底 */
  --bg-card-hover: #24405e;
  --line: #2c4a6b;           /* 描边 */
  --brand: #35c48d;          /* 品牌绿（教育感） */
  --brand-dim: #1f7a58;
  --gold: #e8b64c;           /* 点数/星星，少量使用 */
  --text: #e8eef5;
  --text-dim: #8ba3bd;
  --danger: #e05a4e;

  /* 打分四段配色（全平台统一）：很好=绿 一般=蓝 不好=橙 极差=红 */
  --grade-good: #35c48d;
  --grade-normal: #4a9de0;
  --grade-bad: #e8964c;
  --grade-worst: #e05a4e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 横屏舞台：所有页面内容装在16:9舞台里 ---------- */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;  /* 手机浏览器：扣掉地址栏/标签栏后的实际可见高度；老浏览器不认时自动退回上一行100vh */
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -20%, #1c3450 0%, transparent 60%),
    var(--bg-deep);
  display: flex;
  flex-direction: column;
}

/* 竖屏提示：原型统一横屏，竖着拿手机时盖一层提示
   只在真手机宽度（≤600px）才拦；电脑窗口窄不拦；点一下提示层也能关掉（common.js） */
.rotate-tip { display: none; }
@media (orientation: portrait) and (max-width: 600px) {
  .rotate-tip {
    display: flex;
    position: fixed; inset: 0; z-index: 999;
    background: var(--bg-deep);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; color: var(--text-dim); font-size: 16px;
  }
  .rotate-tip .phone-ico { font-size: 48px; animation: rot 1.6s ease infinite; }
  @keyframes rot { 0%,20% { transform: rotate(0); } 60%,100% { transform: rotate(90deg); } }
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 52px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: rgba(13, 23, 38, .85);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.topbar .back {
  color: var(--text-dim); text-decoration: none;
  font-size: 13px; white-space: nowrap; flex-shrink: 0;
}
.topbar .back:hover { color: var(--text); }
.topbar .title { font-size: 17px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .chip {
  padding: 4px 12px; border-radius: 20px; font-size: 12px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--line);
}

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 26px; border-radius: 10px; border: none;
  font-size: 15px; cursor: pointer; text-decoration: none;
  color: #06281a; background: var(--brand); font-weight: 600;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line);
}
.btn.big { padding: 13px 40px; font-size: 17px; border-radius: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 6px;
  font-size: 12px; line-height: 18px;
}
.tag.easy  { background: rgba(53,196,141,.15); color: var(--grade-good); }
.tag.mid   { background: rgba(74,157,224,.15); color: var(--grade-normal); }
.tag.hard  { background: rgba(224,90,78,.15);  color: var(--grade-worst); }

/* 星标 */
.stars { color: var(--gold); letter-spacing: 2px; font-size: 14px; }
.stars .off { color: #3a5678; }

/* ---------- 扑克牌面渲染（选牌器/牌例/手牌通用） ---------- */
.pk {
  display: inline-flex; flex-direction: column; justify-content: space-between;
  width: 46px; height: 64px;
  background: #f7f9fc; border-radius: 6px;
  border: 1px solid #c9d4e0;
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
  padding: 3px 4px;
  font-weight: 700; font-size: 15px; line-height: 1;
  position: relative; user-select: none;
  color: #222;
}
.pk.red { color: #d6382c; }
.pk .suit { font-size: 12px; }
.pk .mid-suit {
  position: absolute; right: 5px; bottom: 4px; font-size: 20px;
}
.pk.joker { color: #d6382c; font-size: 11px; writing-mode: vertical-lr; padding-top: 5px; }
.pk.joker.black { color: #222; }
.pk.sel { transform: translateY(-10px); border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.pk.small { width: 34px; height: 48px; font-size: 12px; }
.pk.small .mid-suit { font-size: 14px; }

/* 手牌一字排开：负间距叠牌 */
.hand { display: flex; padding-left: 10px; }
.hand .pk { margin-left: -14px; cursor: pointer; transition: transform .12s; }
.hand .pk:first-child { margin-left: 0; }

/* ---------- 原型水印 ---------- */
.proto-mark {
  position: fixed; right: 8px; bottom: 6px; z-index: 50;
  font-size: 11px; color: #3a5678; pointer-events: none;
}
