/* 賽事模擬(動畫)—— 沿用 styles.css 變數 */

/* 讓 hidden 屬性一律生效(避免被 display 規則蓋過)*/
[hidden] { display: none !important; }

main { text-align: center; }

/* 選隊 */
.setup { padding: clamp(40px, 7vw, 90px) 0 40px; }
.pick-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 3vw, 28px);
  align-items: end; max-width: 620px; margin: clamp(28px, 4vw, 44px) auto 0; text-align: left;
}
.team-pick { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.team-pick label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.team-pick select {
  appearance: none; width: 100%; font-family: var(--display); font-weight: 600;
  font-size: clamp(15px, 2.2vw, 19px); color: var(--text); background: #0c110b;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.team-pick select:focus { outline: none; border-color: rgba(94,243,140,0.45); }
.vs-badge { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--accent); padding-bottom: 12px; }

.kickoff-btn {
  margin-top: clamp(28px, 4vw, 40px);
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 0.02em;
  color: #06140b; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: none; border-radius: 12px; padding: 16px 44px; cursor: pointer;
  box-shadow: 0 10px 34px -12px var(--glow); transition: transform 0.15s, box-shadow 0.15s;
}
.kickoff-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px var(--glow); }
.kickoff-btn:active { transform: translateY(0); }

/* 批次模擬 */
.batch-box {
  max-width: 620px; margin: clamp(36px, 5vw, 56px) auto 0; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; padding: 22px clamp(18px, 3vw, 28px);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
}
.batch-head { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.batch-head .dim { font-family: var(--sans); font-weight: 400; font-size: 12px; margin-left: 8px; }
.batch-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-ctrl input {
  width: 110px; font-family: var(--mono); font-size: 15px; color: var(--text);
  background: #0c110b; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
}
.batch-ctrl input:focus { outline: none; border-color: rgba(94,243,140,0.45); }
.batch-unit { font-size: 13px; color: var(--muted); }
.batch-ctrl button {
  font-family: var(--sans); font-weight: 700; font-size: 14px; cursor: pointer;
  color: var(--accent); background: transparent; border: 1px solid rgba(94,243,140,0.4);
  border-radius: 9px; padding: 10px 20px; transition: background 0.2s, transform 0.15s;
}
.batch-ctrl button:hover { background: rgba(94,243,140,0.08); transform: translateY(-1px); }
.batch-note { margin-top: 14px; font-size: 11.5px; color: var(--dim); }
.batch-note a { color: var(--accent-2); }

.batch-out { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.bt-head { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 12px; }
.bt-row, .bt-srow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bt-label { font-size: 12.5px; width: 110px; flex-shrink: 0; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-skey { font-size: 12px; width: 38px; flex-shrink: 0; color: var(--text); }
.bt-track { flex: 1; height: 9px; background: #161c14; border-radius: 6px; overflow: hidden; }
.bt-track i { display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(94,243,140,0.35); }
.bt-val { font-size: 12px; width: 52px; text-align: right; flex-shrink: 0; color: var(--accent); }
.bt-exact { font-size: 10.5px; width: 84px; text-align: right; flex-shrink: 0; color: var(--dim); }
.bt-sub { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); }
.bt-scores { margin-top: 16px; }
.bt-scores-title { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.bt-srow .bt-track i { background: #3a463c; box-shadow: none; }

@media (max-width: 520px) {
  .bt-exact { display: none; }
  .bt-label { width: 84px; }
}

/* 比賽 */
.match { padding: clamp(20px, 3vw, 32px) 0; }
.scoreboard {
  display: inline-grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  padding: 12px 22px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); margin-bottom: 18px; position: relative;
}
.sb-team { font-family: var(--display); font-weight: 700; font-size: clamp(15px, 2.4vw, 20px); }
.sb-team.home { color: var(--accent); text-align: right; }
.sb-team.away { color: #e7ebe4; text-align: left; }
.sb-score { font-size: clamp(24px, 4vw, 34px); font-weight: 700; letter-spacing: 0.04em; }
.sb-score .sep { color: var(--dim); margin: 0 4px; }
.sb-clock {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--bg); background: var(--accent); padding: 2px 10px; border-radius: 20px;
}

.pitch-wrap { position: relative; display: inline-block; max-width: 100%; }
#pitch {
  width: 100%; max-width: 900px; height: auto; border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 20px 60px -30px #000;
}
.goal-flash {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: clamp(48px, 11vw, 110px);
  color: var(--accent); text-shadow: 0 0 50px var(--glow); letter-spacing: 0.04em;
  opacity: 0; pointer-events: none;
}
.goal-flash.show { animation: goalPop 1.3s ease-out; }
@keyframes goalPop {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: scale(1.1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.2); }
}

/* 結果 overlay */
.result-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px; padding: 24px;
  background: rgba(4, 6, 4, 0.82); backdrop-filter: blur(8px);
  animation: rise 0.4s ease-out;
}
.result-card {
  width: min(440px, 92vw); padding: 36px 32px; border-radius: 18px; text-align: center;
  border: 1px solid rgba(94,243,140,0.3);
  background: radial-gradient(120% 90% at 50% 0%, rgba(94,243,140,0.12), var(--panel) 60%);
  box-shadow: 0 30px 80px -30px #000;
}
.rc-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; color: var(--accent-2); margin-bottom: 24px; }
.rc-teams { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rc-teams > span:first-child { color: var(--accent); }
.rc-teams > span:last-child { color: #e7ebe4; }
.rc-teams span { font-family: var(--display); font-weight: 700; font-size: clamp(15px, 4vw, 20px); flex: 1; }
.rc-score { flex: 0 0 auto !important; font-size: clamp(30px, 9vw, 46px) !important; color: var(--text) !important; }
.rc-note { margin-top: 22px; font-size: 12px; color: var(--muted); }

.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.result-actions button {
  font-family: var(--sans); font-weight: 600; font-size: 15px; cursor: pointer;
  border-radius: 11px; padding: 13px 26px; border: 1px solid var(--line);
  color: #06140b; background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.result-actions button.ghost { color: var(--text); background: transparent; }
.result-actions button.ghost:hover { border-color: rgba(94,243,140,0.4); }

/* 下一輪真實賽程 */
.fixtures-box {
  max-width: 620px; margin: clamp(36px, 5vw, 56px) auto 0; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; padding: 22px clamp(18px, 3vw, 28px);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
}
.fx-head { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.fx-head .dim { font-family: var(--sans); font-weight: 400; font-size: 12px; margin-left: 8px; }
.fx-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.fx-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.fx-row:hover:not(:disabled) { border-color: rgba(94,243,140,0.3); background: rgba(94,243,140,0.05); }
.fx-row:disabled { cursor: default; opacity: 0.45; }
.fx-date { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); min-width: 118px; }
.fx-teams { flex: 1; font-weight: 500; }
.fx-teams i { font-style: normal; color: var(--dim); font-size: 11px; margin: 0 4px; }
.fx-go { flex: 0 0 auto; font-size: 12px; color: var(--accent); }
.fx-row:disabled .fx-go { color: var(--dim); }
.fx-note { margin-top: 14px; font-size: 11.5px; color: var(--dim); }
@media (max-width: 560px) {
  .fx-date { min-width: 0; }
  .fx-row { flex-wrap: wrap; gap: 4px 10px; }
}

/* 開賽鈕脈衝(點賽程帶入後提示) */
.kickoff-btn.pulse { animation: kb-pulse 0.9s ease 2; }
@keyframes kb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94,243,140,0); }
  40% { box-shadow: 0 0 0 10px rgba(94,243,140,0.18); }
}
