/* ============ 设计令牌：鎏金赌场 ============ */
:root {
  --ink: #0b0f0c;            /* 页面底色：近黑的墨绿 */
  --ink-2: #111813;
  --felt: #0e3d2a;           /* 祖母绿毛毡 */
  --felt-deep: #0a2b1e;
  --gold: #c9a151;           /* 古金 */
  --gold-bright: #f0d68a;    /* 高光金 */
  --gold-dim: #8a6f3a;
  --ivory: #f3ead7;          /* 象牙白（牌面/亮文本） */
  --wood: #3b2417;           /* 胡桃木 */
  --crimson: #b03a46;        /* 红花色/危险 */
  --text: #e9e2d0;
  --text-dim: #a89f88;

  --font-display: "Palatino", "Palatino Linotype", "Songti SC", "STSong", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", system-ui, sans-serif;
  --font-num: "DIN Alternate", "Avenir Next Condensed", "Helvetica Neue", sans-serif;

  --img-felt: none;
  --img-lobby: none;
  --img-cardback: none;
  --img-dealer: none;
  --img-logo: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#app, #app > section { position: fixed; inset: 0; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
img { -webkit-user-drag: none; }

/* ---- 通用金框按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 15px; letter-spacing: .08em;
  color: var(--gold-bright);
  background: linear-gradient(180deg, #2a2118, #1a140d);
  border: 1px solid var(--gold-dim);
  box-shadow: inset 0 1px 0 rgba(240,214,138,.15), 0 2px 8px rgba(0,0,0,.5);
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.primary {
  color: #1c1508;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, #a37f35);
  border-color: var(--gold-bright);
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255,255,255,.3);
}
.btn.danger { color: #f2c7cc; border-color: #6e2a31; background: linear-gradient(180deg, #3a1518, #240d0f); }
.btn.ghost { background: rgba(0,0,0,.35); }

/* ---- 统一 UI 皮肤（生成的按钮板材可用时，html.ui-skin 由 main.js 打开） ---- */
html.ui-skin .btn {
  background: var(--img-btn-dark) center / 100% 100% no-repeat;
  border-color: rgba(201,161,81,.35);
  color: var(--gold-bright);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
html.ui-skin .btn.primary {
  background: var(--img-btn-gold) center / 100% 100% no-repeat;
  border-color: rgba(240,214,138,.55);
  color: #221807;
  text-shadow: 0 1px 0 rgba(255,244,200,.5);
}
html.ui-skin .btn.danger {
  background: var(--img-btn-red) center / 100% 100% no-repeat;
  border-color: rgba(168,50,64,.5);
  color: #ffe3e6;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
html.ui-skin .btn.ghost {
  background: var(--img-btn-dark) center / 100% 100% no-repeat;
  opacity: .92;
}

/* ---- 输入 ---- */
.field {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0,0,0,.45);
  border: 1px solid #3a3226;
  color: var(--ivory);
  font-size: 15px;
  outline: none;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,161,81,.2); }
select.field option { background: #1a140d; }

/* ---- toast ---- */
#toast-root {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 500; pointer-events: none;
}
.toast {
  padding: 9px 20px;
  border-radius: 20px;
  background: rgba(12,10,6,.92);
  border: 1px solid var(--gold-dim);
  color: var(--gold-bright);
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
  animation: toastIn .25s ease;
}
.toast.warn { color: #f2c7cc; border-color: #6e2a31; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---- modal ---- */
#modal-root:not(:empty) {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(5,7,5,.72);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal {
  min-width: 300px; max-width: 90vw;
  background: linear-gradient(180deg, #17130c, #0e0b07);
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
.modal h3 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 19px; font-weight: 600;
  margin-bottom: 14px; letter-spacing: .06em;
}
.modal .row { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }

/* ---- 竖屏遮罩（仅小屏竖屏时显示） ---- */
#portrait-guard { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  #portrait-guard {
    display: flex; position: fixed; inset: 0; z-index: 900;
    background: radial-gradient(ellipse at center, #142418, var(--ink) 75%);
    align-items: center; justify-content: center; text-align: center;
  }
}
.pg-phone { font-size: 52px; animation: rotatePhone 1.8s ease-in-out infinite; }
.pg-title { font-family: var(--font-display); font-size: 22px; color: var(--gold-bright); margin-top: 18px; letter-spacing: .15em; }
.pg-sub { color: var(--text-dim); margin-top: 8px; font-size: 14px; }
@keyframes rotatePhone {
  0%, 20% { transform: rotate(0); }
  55%, 80% { transform: rotate(90deg); }
  100% { transform: rotate(90deg); }
}

/* ---- 金色分隔线 ---- */
.gold-rule {
  height: 1px; border: none;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
