/* =====================================================================
   AgentSoccer 设计系统（theme.css）——所有屏共用的 token 与组件。
   风格：FIFA 风暗色电竞 UI——深蓝底、青色霓虹 accent、金色强调、毛玻璃卡片。
   各屏自己的布局样式写在 screens-*.css，组件优先复用这里的 .t-* 类。
   ===================================================================== */

:root {
  /* ---- 色板 ---- */
  --bg-0: #070b14;            /* 最深底 */
  --bg-1: #0c1322;            /* 屏幕背景 */
  --bg-2: #121b2e;            /* 面板底 */
  --panel: rgba(18, 27, 46, 0.82);
  --panel-solid: #16203a;
  --line: rgba(94, 130, 190, 0.22);      /* 描边 */
  --line-strong: rgba(110, 160, 235, 0.45);

  --accent: #2dd4ff;          /* 青色霓虹（主交互色） */
  --accent-dim: rgba(45, 212, 255, 0.14);
  --gold: #f5c34b;            /* 金色（评分/高亮） */
  --ok: #34d399;
  --danger: #f3645c;

  --text-0: #eef4ff;          /* 主文字 */
  --text-1: #9fb2d4;          /* 次级 */
  --text-2: #5e7196;          /* 弱化 */

  /* ---- 几何 ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 18px rgba(45, 212, 255, 0.25);
}

/* ---- 全局微调 ---- */
body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(45, 212, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(245, 195, 75, 0.05), transparent 60%),
    var(--bg-1);
}

/* 滚动条（webkit） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(94, 130, 190, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(45, 212, 255, 0.5); }

/* =====================================================================
   组件
   ===================================================================== */

/* ---- 卡片 ---- */
.t-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}
.t-card-flat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

/* ---- 面板标题（左侧竖条 accent） ---- */
.t-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: 1px;
}
.t-title::before {
  content: "";
  width: 5px;
  height: 1em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #1879b8);
  box-shadow: var(--shadow-glow);
}
.t-subtitle {
  font-size: 24px;
  color: var(--text-1);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ---- 按钮 ---- */
.t-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(60, 90, 150, 0.35), rgba(30, 48, 86, 0.5));
  color: var(--text-0);
  font-size: 26px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.t-btn:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.t-btn:active { transform: translateY(0); }
.t-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.t-btn-primary {
  background: linear-gradient(180deg, #19b8e8, #0e7fb6);
  border-color: rgba(45, 212, 255, 0.7);
  color: #04121d;
  font-weight: 700;
}
.t-btn-primary:hover { background: linear-gradient(180deg, #2dd4ff, #129ad0); }

.t-btn-gold {
  background: linear-gradient(180deg, #f5c34b, #c98f1f);
  border-color: rgba(245, 195, 75, 0.7);
  color: #221703;
  font-weight: 700;
}

.t-btn-danger {
  background: linear-gradient(180deg, rgba(180, 60, 55, 0.6), rgba(120, 35, 32, 0.7));
  border-color: rgba(243, 100, 92, 0.6);
}
.t-btn-danger:hover { border-color: var(--danger); box-shadow: 0 0 14px rgba(243, 100, 92, 0.3); }

.t-btn-ghost {
  background: transparent;
  border-color: var(--line);
}

/* ---- 列表行 ---- */
.t-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(30, 44, 76, 0.45);
  border: 1px solid transparent;
  transition: all 0.12s ease;
  cursor: pointer;
}
.t-row:hover { background: rgba(40, 60, 104, 0.6); border-color: var(--line); }
.t-row.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: inset 0 0 12px rgba(45, 212, 255, 0.08);
}
.t-row.fielded { border-left: 3px solid var(--ok); }

/* ---- 头像 ---- */
.t-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-strong);
  background: #0a1020;
  flex: none;
}
.t-avatar-sm { width: 40px; height: 40px; }
.t-avatar-lg { width: 96px; height: 96px; border-width: 3px; }
.t-avatar.gk { border-color: var(--gold); }

/* ---- 国旗（emoji） ---- */
.t-flag { font-size: 1.2em; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }

/* ---- 徽章 ---- */
.t-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.t-badge-role { background: rgba(45, 212, 255, 0.15); color: var(--accent); border: 1px solid rgba(45, 212, 255, 0.35); }
.t-badge-gold { background: rgba(245, 195, 75, 0.15); color: var(--gold); border: 1px solid rgba(245, 195, 75, 0.4); }
.t-badge-ok { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35); }
.t-badge-dim { background: rgba(94, 113, 150, 0.18); color: var(--text-1); border: 1px solid var(--line); }

/* ---- 评分（OVR 大数字） ---- */
.t-ovr {
  font-size: 40px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(245, 195, 75, 0.35);
  line-height: 1;
}
.t-ovr-sm { font-size: 28px; }

/* ---- 属性条 ---- */
.t-stat {
  display: grid;
  grid-template-columns: 64px 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  color: var(--text-1);
}
.t-stat .bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(20, 30, 52, 0.9);
  overflow: hidden;
}
.t-stat .bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #1ba7d8, var(--accent));
}
.t-stat .bar > i.hi { background: linear-gradient(90deg, #d8a31b, var(--gold)); }
.t-stat .val { text-align: right; color: var(--text-0); font-weight: 700; }

/* ---- 分隔标题（名单分组：门将/后卫/中场/前锋） ---- */
.t-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 2px 6px;
  font-size: 21px;
  color: var(--text-2);
  letter-spacing: 2px;
}
.t-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- 输入 ---- */
.t-input {
  background: rgba(10, 16, 32, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-0);
  padding: 10px 14px;
  font-size: 26px;
  outline: none;
  transition: border 0.15s;
}
.t-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45, 212, 255, 0.12); }

/* ---- 顶栏（屏幕标题条） ---- */
.t-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(22, 34, 60, 0.9), rgba(14, 21, 38, 0.9));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

/* ---- 空状态 ---- */
.t-empty {
  text-align: center;
  color: var(--text-2);
  padding: 30px 10px;
  font-size: 24px;
}

/* ---- 静音开关（🔊/🔇）：圆形小按钮，固定屏幕角落，https://d1u4k7xc6u3yed.cloudfront.net/agent-soccer/js/audio.js 接管 ---- */
.audio-mute {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(18, 27, 46, 0.72);
  backdrop-filter: blur(6px);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  z-index: 60;
  pointer-events: auto; /* 比赛屏挂在 pointer-events:none 的 HUD 下，需显式恢复 */
  transition: all 0.15s ease;
}
.audio-mute:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.audio-mute-img { width: 60%; height: 60%; object-fit: contain; pointer-events: none; }

/* gpt-image-2 生成的按钮内联图标（替代原 emoji 前缀）：图标 + 文案居中排列 */
.fc-btn:has(.btn-ico), .st3-abtn:has(.btn-ico) {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
}
.btn-ico { width: 1.5em; height: 1.5em; object-fit: contain; flex: 0 0 auto; pointer-events: none; }
.hm-av-edit .btn-ico, .hm-av-hint .btn-ico { width: 100%; height: 100%; }
/* 比赛屏：右上被记分条/控制列占用，挪到右下角（解说条上方） */
#screen-match .audio-mute { top: auto; bottom: 150px; right: 24px; }
/* 比赛屏横版：解说条变底部横贯（main.css），静音钮沉到右下角黑边处，不挡场地 */
body.landscape #screen-match .audio-mute { bottom: 24px; right: 24px; }

/* ---- 语言切换（中/EN）：右上角紧凑胶囊按钮，登录页/首页各一个 ---- */
.lang-toggle {
  position: absolute;
  top: 28px;
  right: 28px;
  min-width: 96px;
  padding: 14px 26px;
  font-size: 28px;
  letter-spacing: 2px;
  z-index: 60;
  background: rgba(18, 27, 46, 0.72);
  backdrop-filter: blur(6px);
}
/* 首页右上角已有静音钮：语言切换挪到它左侧 */
#screen-home .lang-toggle { right: 116px; }

/* ====== 语言选择器（7 语言）：覆盖层 + 卡片 + 列表 ======
   覆盖层挂在 <body> 上、位于 #stage 缩放之外，故用真实视口 px 尺寸。 */
.lang-picker-ov {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 16, .62); backdrop-filter: blur(3px); padding: 20px;
  animation: asLangFade .14s ease;
}
@keyframes asLangFade { from { opacity: 0 } to { opacity: 1 } }
.lang-picker {
  width: 100%; max-width: 320px; background: #131a26; color: #fff;
  border: 1px solid #2a3645; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5); font-size: 15px;
}
.lang-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #2a3645; font-size: 16px; font-weight: 700;
}
.lang-picker-sub { padding: 12px 16px 4px; font-size: 12px; letter-spacing: .4px; color: #97a3b4; text-transform: uppercase; }
.lang-picker-x {
  background: none; border: none; color: #97a3b4; font-size: 16px; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; transition: .14s; line-height: 1;
}
.lang-picker-x:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lang-picker-list { display: flex; flex-direction: column; padding: 6px; max-height: 60vh; overflow-y: auto; }
.lang-opt {
  display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; color: #e8eef6; text-align: left;
  padding: 12px 14px; border-radius: 10px; font-size: 15px; cursor: pointer; transition: .14s;
}
.lang-opt:hover { background: rgba(255, 255, 255, .07); }
.lang-opt.is-cur { background: rgba(54, 209, 255, .16); color: #36d1ff; font-weight: 700; }
.lang-opt-tick { color: #36d1ff; font-weight: 800; }
