/* 皇室战争（极简版）弹窗样式 —— 深蓝主题，适配手机竖屏 */
#royal-modal .rc-root { --rc-gold:#ffd93b; --rc-red:#ef4444; --rc-blue:#3b82f6; }
#royal-modal .rc-root * { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
#royal-modal .rc-root [hidden] { display:none !important; }
#royal-modal .rc-root {
  font-family:"PingFang SC","Microsoft YaHei",sans-serif;
  color:#eef; user-select:none;
}
#royal-modal .rc-root button { cursor:pointer; touch-action:manipulation; font-family:inherit; }

/* 稀有度 */
#royal-modal .rarity-common { border-color:#c8c8c8 !important; }
#royal-modal .rarity-rare { border-color:#ff9800 !important; }
#royal-modal .rarity-epic { border-color:#9c27b0 !important; }
#royal-modal .rarity-legendary { border:2px solid transparent !important; border-image:linear-gradient(135deg,#ff5f6d,#ffc93b,#6fd0ff,#9c27b0) 1 !important; }

/* ============ 弹窗骨架 ============ */
#royal-modal .rc-root {
  position:relative;
  width:100%; height:100%;
  display:flex; justify-content:center;
  background:#0d1b2a;
  overflow:hidden;
}
#royal-modal .rc-page {
  width:100%; max-width:560px; height:100%;
  display:flex; flex-direction:column;
  background:linear-gradient(180deg,#123,#0d1b2a 60%);
  position:relative;
}

/* ============ 面板切换（主页/牌库/设置/对局） ============ */
#royal-modal .rc-panel { width:100%; height:100%; display:flex; flex-direction:column; }
#royal-modal .rc-panel.hidden, #royal-modal .hidden { display:none !important; }

/* ============ 主页 ============ */
#royal-modal .rc-home {
  align-items:center; justify-content:center; text-align:center; gap:8px;
  padding:12px;
}
#royal-modal .rc-home-emoji { font-size:44px; filter:drop-shadow(0 4px 10px rgba(255,200,50,.5)); }
#royal-modal .rc-home-title {
  font-size:28px; font-weight:800; letter-spacing:3px;
  background:linear-gradient(90deg,#ffd93b,#ff8a3b);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
#royal-modal .rc-trophy { display:flex; align-items:center; gap:8px; margin-top:2px; }
#royal-modal .rc-trophy-icon { font-size:24px; }
#royal-modal .rc-trophy-num { font-size:24px; font-weight:800; color:var(--rc-gold); letter-spacing:1px; }
#royal-modal .rc-rank {
  font-size:13px; font-weight:700; color:#fff;
  background:linear-gradient(135deg,#3a5570,#2a4560);
  padding:2px 10px; border-radius:12px;
}
#royal-modal .rc-rank-bar { width:100%; max-width:260px; height:8px; border-radius:5px; background:rgba(255,255,255,.12); overflow:hidden; margin-top:4px; }
#royal-modal .rc-rank-fill { height:100%; border-radius:5px; background:linear-gradient(90deg,#ffd93b,#ff9a3b); transition:width .5s; }
#royal-modal .rc-rank-progress { font-size:11px; color:#8aa; margin-top:2px; }
#royal-modal .rc-menu { display:flex; flex-direction:column; gap:8px; width:100%; max-width:280px; margin-top:4px; }
#royal-modal .rc-menu-btn {
  padding:10px 0; border:none; border-radius:14px; font-size:15px; font-weight:700;
  letter-spacing:2px; background:rgba(255,255,255,.08); color:#dce8f5;
  transition:transform .12s, background .2s;
}
#royal-modal .rc-menu-btn.primary { background:linear-gradient(135deg,#ffd93b,#ffb02b); color:#312000; box-shadow:0 8px 24px rgba(255,190,50,.35); }
#royal-modal .rc-menu-btn:active { transform:scale(.96); }
#royal-modal .rc-home-deck { display:flex; flex-wrap:wrap; justify-content:center; gap:5px; margin-top:4px; max-width:340px; }
#royal-modal .rc-mini {
  width:52px; min-height:46px; border-radius:8px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:2px; color:#fff; font-weight:700;
  border:2px solid rgba(255,255,255,.35); padding:3px 2px;
}
#royal-modal .rc-mi { font-size:15px; line-height:1; }
#royal-modal .rc-mn { font-size:9px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.8); white-space:nowrap; }
#royal-modal .rc-home-desc { font-size:11px; color:#7a94ad; line-height:1.6; margin-top:2px; }

/* ============ 对局 ============ */
#royal-modal .rc-topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 10px; background:rgba(255,255,255,.04); border-bottom:1px solid rgba(255,255,255,.08);
  flex-shrink:0; position:relative; z-index:50;
}
#royal-modal .rc-timer { font-size:13px; font-weight:800; color:var(--rc-gold); letter-spacing:1px; }
#royal-modal .rc-ai-diff { font-size:10px; color:#9ab; background:rgba(255,255,255,.1); padding:1px 7px; border-radius:8px; font-weight:700; }
#royal-modal .rc-crown-score { font-size:16px; font-weight:800; color:var(--rc-gold); letter-spacing:2px; background:rgba(255,217,59,.1); padding:2px 12px; border-radius:12px; }
#royal-modal .rc-crown-score span { color:#fff; }
#royal-modal .rc-act-btn {
  border:none; background:rgba(255,255,255,.12); color:var(--rc-gold);
  width:30px; height:30px; border-radius:50%; font-size:14px; font-weight:700; cursor:pointer;
}
#royal-modal .rc-act-btn.quit { color:#ff6b6b; }
#royal-modal .rc-stage {
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  background:rgba(20,30,45,.85); color:var(--rc-gold); padding:4px 12px; border-radius:14px;
  font-size:12px; font-weight:800; letter-spacing:1px; z-index:20; border:1px solid rgba(255,217,59,.4);
  pointer-events:none; white-space:nowrap;
}
#royal-modal .rc-stage.sudden { color:#ff6b6b; border-color:rgba(255,80,80,.6); animation:rcPulse 1s infinite; }
@keyframes rcPulse { 0%,100%{opacity:1} 50%{opacity:.55} }

#royal-modal .rc-arena-wrap { flex:1; min-height:0; display:flex; align-items:center; justify-content:center; position:relative; }
#royal-modal #rc-arena {
  height:100%; max-height:100%; aspect-ratio:18/32; border-radius:6px;
  touch-action:none; box-shadow:0 0 24px rgba(0,0,0,.5); background:#7ac74f;
  display:block;
}

/* 弹层 */
#royal-modal .rc-overlay {
  position:absolute; inset:0; background:rgba(5,10,20,.72);
  display:flex; align-items:center; justify-content:center; z-index:30;
}
#royal-modal .rc-overlay[hidden] { display:none; }
#royal-modal .rc-overlay-box {
  background:linear-gradient(180deg,#16283f,#10203a); border:2px solid rgba(255,217,59,.35);
  border-radius:18px; padding:24px 32px; text-align:center; box-shadow:0 12px 40px rgba(0,0,0,.6);
}
#royal-modal .rc-ov-title { font-size:26px; font-weight:800; color:var(--rc-gold); margin-bottom:8px; }
#royal-modal .rc-ov-msg { color:#aebdcc; font-size:13px; margin-bottom:16px; line-height:1.7; }
#royal-modal .rc-ov-btns { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
#royal-modal .rc-ov-btn {
  padding:10px 18px; border:none; border-radius:14px; font-size:14px; font-weight:700;
  background:rgba(255,255,255,.1); color:#eef;
}
#royal-modal .rc-ov-btn.primary { background:linear-gradient(135deg,#ffd93b,#ffb02b); color:#312000; }
#royal-modal .rc-ov-btn:active { transform:scale(.96); }

/* 底部条 */
#royal-modal .rc-bottom {
  padding:6px 8px 8px; background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.02));
  border-top:1px solid rgba(255,255,255,.08); display:flex; align-items:flex-end; gap:6px; flex-shrink:0;
}
#royal-modal .rc-hand { flex:1; display:flex; gap:5px; justify-content:space-between; }
#royal-modal .rc-card {
  flex:1; aspect-ratio:4/5.2; max-width:76px; border-radius:10px; position:relative;
  cursor:pointer; touch-action:none; border:2px solid rgba(255,255,255,.25);
  background:rgba(30,50,75,.6); display:flex; flex-direction:column; align-items:center;
  justify-content:center; transition:transform .12s, border-color .12s;
}
#royal-modal .rc-cost {
  position:absolute; top:-7px; left:-5px; width:20px; height:20px; border-radius:50%;
  background:#9b59b6; color:#fff; font-size:12px; font-weight:800;
  display:flex; align-items:center; justify-content:center; border:2px solid #fff;
}
#royal-modal .rc-icon {
  width:26px; height:26px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; font-size:16px; color:#fff; font-weight:800; margin-bottom:4px;
}
#royal-modal .rc-card .rc-cname { font-size:9px; color:#cde; font-weight:700; }
#royal-modal .rc-card.selected { transform:translateY(-8px); box-shadow:0 0 0 2px var(--rc-gold), 0 6px 16px rgba(255,217,59,.35); }
#royal-modal .rc-card.disabled { filter:grayscale(.7); opacity:.5; }

#royal-modal .rc-next-wrap { display:flex; flex-direction:column; align-items:center; gap:3px; }
#royal-modal .rc-next-label { font-size:9px; color:#8aa; }
#royal-modal .rc-next {
  width:34px; height:44px; border-radius:8px; border:2px dashed rgba(255,255,255,.3);
  display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.05);
}
#royal-modal .rc-my-row { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
#royal-modal .rc-elixir-track { width:120px; height:10px; border-radius:6px; background:rgba(255,255,255,.12); overflow:hidden; }
#royal-modal .rc-elixir-fill { height:100%; width:50%; border-radius:6px; background:linear-gradient(90deg,#3498db,#6fd0ff); transition:width .3s; }
#royal-modal .rc-elixir-num { font-size:14px; font-weight:800; color:#6fd0ff; }
#royal-modal .rc-tower-hps { display:flex; gap:6px; font-size:10px; color:#bcd; }
#royal-modal .rc-thp { display:flex; align-items:center; gap:2px; }

/* ============ 牌库 / 设置 ============ */
#royal-modal .rc-deck-panel, #royal-modal .rc-settings-panel { padding:10px 12px; overflow-y:auto; }
#royal-modal .rc-page-head {
  display:flex; align-items:center; gap:8px; padding-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,.1); flex-shrink:0;
}
#royal-modal .rc-back-btn, #royal-modal .rc-save-btn {
  padding:7px 14px; border:none; border-radius:12px; font-size:13px; font-weight:700;
  background:rgba(255,255,255,.1); color:#eef;
}
#royal-modal .rc-save-btn { background:linear-gradient(135deg,#ffd93b,#ffb02b); color:#312000; }
#royal-modal .rc-deck-tabs { flex:1; display:flex; gap:6px; justify-content:center; }
#royal-modal .rc-dtab {
  flex:1; padding:7px 4px; border:none; border-radius:10px; font-size:12px; font-weight:700;
  background:rgba(255,255,255,.07); color:#bcd;
}
#royal-modal .rc-dtab.active { background:rgba(255,217,59,.2); color:var(--rc-gold); }
#royal-modal .rc-deck-title { font-size:12px; color:#8aa; margin:10px 0 6px; font-weight:700; }
#royal-modal .rc-deck-avg { font-size:11px; color:#8ecbff; margin-left:8px; font-weight:700; }
#royal-modal .rc-deck-current { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
#royal-modal .rc-dslot {
  width:100%; aspect-ratio:4/5.2; border-radius:10px; position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:rgba(30,50,75,.6); border:2px solid rgba(255,255,255,.2); cursor:pointer;
}
#royal-modal .rc-dslot.empty { background:rgba(255,255,255,.04); border-style:dashed; }
#royal-modal .rc-plus { font-size:22px; color:#6a8; }
#royal-modal .rc-slotx {
  position:absolute; top:-7px; right:-7px; width:20px; height:20px; border-radius:50%;
  border:none; background:rgba(255,70,70,.92); color:#fff; font-size:12px; font-weight:800;
  line-height:1; cursor:pointer; z-index:2;
}
#royal-modal .rc-deck-info { font-size:11px; color:#789; margin:8px 0 2px; }
#royal-modal .rc-detail-toggle { display:flex; align-items:center; gap:6px; font-size:12px; color:#bcd; cursor:pointer; margin:8px 0 2px; user-select:none; }
#royal-modal .rc-detail-toggle input { width:16px; height:16px; accent-color:var(--rc-gold); cursor:pointer; }
#royal-modal .rc-deck-pool { display:grid; grid-template-columns:repeat(auto-fill,minmax(52px,1fr)); gap:6px; padding-bottom:12px; }
#royal-modal .rc-pool {
  aspect-ratio:4/5; border-radius:8px; position:relative; display:flex; flex-direction:column;
  align-items:center; justify-content:center; background:rgba(30,50,75,.5);
  border:2px solid rgba(255,255,255,.15); cursor:pointer; transition:transform .1s;
}
#royal-modal .rc-pool:active { transform:scale(.94); }
#royal-modal .rc-pool.used { opacity:.35; border-color:rgba(100,255,150,.5); }
#royal-modal .rc-pool .rc-cname, #royal-modal .rc-dslot .rc-cname { font-size:9px; color:#cde; font-weight:700; }

#royal-modal .rc-setting-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 2px; border-bottom:1px solid rgba(255,255,255,.08);
}
#royal-modal .rc-setting-label { font-size:14px; font-weight:700; color:#dce8f5; }
#royal-modal .rc-dif {
  padding:8px 16px; border:2px solid #3a5570; border-radius:20px;
  background:rgba(255,255,255,.06); color:#cde; font-size:13px; cursor:pointer;
}
#royal-modal .rc-dif.active { border-color:var(--rc-gold); background:rgba(255,217,59,.18); color:var(--rc-gold); font-weight:700; }
#royal-modal .rc-dif:active { transform:scale(.95); }
#royal-modal .rc-dif-row { display:flex; gap:8px; }
#royal-modal .rc-dpick {
  padding:7px 12px; border:none; border-radius:12px; font-size:12px; font-weight:700;
  background:rgba(255,255,255,.08); color:#bcd;
}
#royal-modal .rc-dpick.active { background:rgba(255,217,59,.2); color:var(--rc-gold); }
#royal-modal .rc-setting-note { font-size:11px; color:#6a8; margin-top:12px; line-height:1.6; }

/* 轻提示 */
.rc-toast {
  position:fixed; left:50%; bottom:130px; transform:translateX(-50%) translateY(20px);
  background:rgba(20,30,45,.95); color:var(--rc-gold,#ffd93b); padding:10px 20px;
  border-radius:14px; font-size:13px; font-weight:700; box-shadow:0 8px 24px rgba(0,0,0,.4);
  opacity:0; pointer-events:none; transition:opacity .25s, transform .25s; z-index:9999;
  font-family:"PingFang SC","Microsoft YaHei",sans-serif;
}
.rc-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* 关闭按钮 */
#royal-modal .rc-close-btn {
  position:absolute; top:8px; right:8px; width:30px; height:30px; border:none; border-radius:50%;
  background:rgba(255,255,255,.15); color:#cde; font-size:15px; font-weight:700; cursor:pointer;
  z-index:40; line-height:1;
}
#royal-modal .rc-close-btn:active { transform:scale(.9); }
