/* =========================================================
   Mini Football — 样式 / Styles
   ========================================================= */

:root {
  --hud-h: 64px;
  --accent: #c8ff3e;
  --accent-dark: #6c9a12;
  --blue: #2f7dff;
  --red: #ff4848;
  --bg: #06110b;
  --panel: rgba(9, 26, 16, 0.94);
  --text: #f2fff0;
  --muted: #a9c7ad;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;              /* 比赛中禁止页面滚动 / no page scrolling */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app { position: fixed; inset: 0; }

/* ---------- 画布区域 / Canvas stage ---------- */
#stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0d2a18 0%, #06110b 75%);
}
#app.in-match #stage { top: var(--hud-h); }

#game {
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--hud-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: linear-gradient(#0d2a18, #07170e);
  border-bottom: 2px solid rgba(200, 255, 62, 0.25);
  z-index: 5;
}
.hud-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-team.right { justify-content: flex-end; }
.hud-name {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(12px, 1.7vw, 18px);
}
.hud-score {
  font-size: clamp(22px, 3.3vw, 36px);
  font-weight: 900;
  min-width: 1.6em;
  text-align: center;
  padding: 0 0.3em;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}
.hud-team.left .hud-score { color: #9cc3ff; }
.hud-team.right .hud-score { color: #ffb0b0; }
.hud-center { display: flex; align-items: center; gap: 10px; }
.hud-time {
  font-size: clamp(18px, 2.7vw, 30px);
  font-weight: 900;
  padding: 2px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.15);
  font-variant-numeric: tabular-nums;
}
.hud-half {
  font-size: clamp(11px, 1.4vw, 14px);
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.hud-time.low { color: #ff5b5b; animation: blink 1s steps(2) infinite; }
.hud-pause {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.hud-pause:hover { background: rgba(200, 255, 62, 0.25); }

.chip {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  flex: none;
  vertical-align: -2px;
}
.chip.blue { background: var(--blue); }
.chip.red { background: var(--red); }

/* ---------- 菜单屏幕 / Menu screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  overflow-y: auto;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(4, 16, 9, 0.45), rgba(2, 8, 4, 0.85));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.panel {
  margin: auto;
  width: min(540px, 100%);
  padding: 28px clamp(18px, 4vw, 36px);
  text-align: center;
  background: var(--panel);
  border: 2px solid rgba(200, 255, 62, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: pop 0.22s ease-out;
}
.panel-wide { width: min(720px, 100%); }
.panel h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.logo {
  margin: 0;
  line-height: 0.95;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 0 #0a2a12, 0 8px 22px rgba(0, 0, 0, 0.6);
}
.logo span { display: block; }
.logo-a { font-size: clamp(28px, 6vw, 44px); color: #fff; }
.logo-b {
  font-size: clamp(40px, 10vw, 74px);
  color: var(--accent);
}
.tagline { margin: 12px 0 0; color: var(--muted); font-size: 15px; letter-spacing: 0.08em; }
.footer-note, .note { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.note { text-align: left; }

.menu { display: grid; gap: 14px; margin-top: 22px; }

/* ---------- 按钮 / Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0b1a10;
  background: #e9f5e6;
  border: none;
  border-radius: 12px;
  box-shadow: 0 5px 0 #8aa38a;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover, .btn:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #8aa38a; }
.btn-primary { background: var(--accent); box-shadow: 0 5px 0 var(--accent-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--accent-dark); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: none;
  border: 2px solid rgba(255, 255, 255, 0.22);
}
.btn-ghost:active { box-shadow: none; }

.btn-card { text-align: left; padding: 14px 18px 14px 22px; position: relative; }
.btn-card .card-title { display: block; font-size: 19px; }
.btn-card .card-desc { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; opacity: 0.7; }
.btn-card::before {
  content: "";
  position: absolute;
  left: 8px; top: 14px; bottom: 14px;
  width: 5px;
  border-radius: 3px;
  background: #3fae5b;
}
.diff-easy::before { background: #3fae5b; }
.diff-normal::before { background: #f3b51b; }
.diff-hard::before { background: #ff4848; }
.btn-card.is-default { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- 设置 / Settings ---------- */
.settings { margin-top: 12px; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
}
.seg button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.seg button:hover { background: rgba(255, 255, 255, 0.1); }
.seg button.active { background: var(--accent); color: #0b1a10; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- 操作说明 / Controls ---------- */
.table-wrap { overflow-x: auto; margin-top: 14px; }
.controls-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.controls-table th, .controls-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  white-space: nowrap;
}
.controls-table th { color: var(--muted); font-size: 13px; letter-spacing: 0.06em; }
kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 3px 7px;
  margin: 2px;
  border-radius: 6px;
  background: #f2f7f2;
  color: #102010;
  font: 700 13px/1.2 ui-monospace, Consolas, "Microsoft YaHei", monospace;
  text-align: center;
  box-shadow: 0 3px 0 #8a9a8a;
}
.tips { margin: 16px 0 0; padding-left: 20px; text-align: left; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ---------- 暂停 & 结束 / Pause & result ---------- */
.pause-score, .result-score {
  margin: 8px 0 0;
  font-size: clamp(34px, 7vw, 54px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.eyebrow { margin: 0; color: var(--muted); letter-spacing: 0.2em; font-weight: 800; text-transform: uppercase; font-size: 13px; }
.result-title { margin-top: 6px !important; font-size: clamp(30px, 6vw, 46px) !important; }
.result-title.blue { color: #7fb0ff; }
.result-title.red { color: #ff8a8a; }
.result-title.draw { color: var(--accent); }
.result-names { margin: 4px 0 0; color: var(--muted); font-weight: 700; }

/* ---------- 语言按钮 / Language toggle ---------- */
.lang-toggle {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 20;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(200, 255, 62, 0.4);
  border-radius: 999px;
  cursor: pointer;
}
.lang-toggle:hover { background: rgba(200, 255, 62, 0.2); }
.in-match .lang-toggle { display: none; }

@keyframes pop {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes blink { 50% { opacity: 0.35; } }

@media (max-width: 520px) {
  :root { --hud-h: 54px; }
  .hud { padding: 0 8px; gap: 6px; }
  .btn { font-size: 16px; padding: 12px 14px; }
}
