/* Wonderkid — clean modern vector, dark theme */
:root {
  --bg: #0c1322;
  --card: #16202f;
  --card2: #1c2839;
  --line: #243248;
  --txt: #eef3f8;
  --dim: #8fa0b5;
  --acc: #3ddc68;
  --acc2: #42a5f5;
  --gold: #ffd54f;
  --bad: #ef5350;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--txt);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }
button { font-family: inherit; }
.hidden { display: none !important; }

#app { max-width: 560px; margin: 0 auto; padding: 14px 14px 48px; }
.screen { display: flex; flex-direction: column; gap: 12px; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- title ---------- */
.title-screen { align-items: center; text-align: center; padding-top: 12vh; min-height: 80vh; }
.title-art { font-size: 84px; filter: drop-shadow(0 12px 24px rgba(61,220,104,.35)); animation: bounce 2.4s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
.logo { font-size: 52px; letter-spacing: 3px; margin: 8px 0 0; font-weight: 900; }
.logo span { color: var(--acc); }
.tagline { color: var(--dim); margin: 4px 0 28px; }
.title-btns { display: flex; flex-direction: column; gap: 12px; width: min(320px, 80vw); }

/* ---------- buttons ---------- */
.btn {
  background: var(--acc); color: #06280f; border: none; border-radius: 14px;
  padding: 13px 18px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.08); }
.btn.big { padding: 16px 22px; font-size: 18px; border-radius: 16px; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.tiny { padding: 6px 12px; font-size: 12px; margin-top: 18px; }
.btn.ghost { background: var(--card2); color: var(--txt); border: 1px solid var(--line); }
.btn.danger { background: #3a1b1f; color: #ff8a80; border: 1px solid #5c2a31; }
.btn.nav { background: var(--card); color: var(--txt); border: 1px solid var(--line); font-size: 15px; }
.btn.disabled { opacity: .4; pointer-events: none; }
.btn:disabled { opacity: .35; cursor: default; }
.btn.play { background: linear-gradient(135deg, var(--acc), #2bbb56); font-size: 20px; letter-spacing: 1px; box-shadow: 0 8px 24px rgba(61,220,104,.25); }

/* ---------- generic ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card-title { font-weight: 800; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.topbar h2 { margin: 0; font-size: 19px; }
.lbl { display: block; color: var(--dim); font-size: 13px; margin-bottom: 8px; font-weight: 600; }
.input {
  width: 100%; background: var(--card2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; font-size: 17px;
}
.input:focus { outline: 2px solid var(--acc); border-color: transparent; }
.center-note { text-align: center; color: var(--dim); margin: 2px 0; font-size: 14px; }
.row-btns { display: flex; gap: 10px; margin-top: 10px; }

/* ---------- new career ---------- */
.flag-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flag-btn {
  background: var(--card2); border: 2px solid var(--line); border-radius: 12px; padding: 8px 2px;
  font-size: 24px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--dim);
}
.flag-btn span { font-size: 10px; }
.flag-btn.sel { border-color: var(--acc); background: #16301f; color: var(--txt); }
.pos-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pos-btn {
  background: var(--card2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 6px;
  cursor: pointer; color: var(--txt); display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center;
}
.pos-btn b { font-size: 18px; color: var(--acc); }
.pos-btn span { font-size: 12px; font-weight: 700; }
.pos-btn small { font-size: 10px; color: var(--dim); line-height: 1.3; }
.pos-btn.sel { border-color: var(--acc); background: #16301f; }

/* ---------- hub ---------- */
.hub-head {
  background: linear-gradient(160deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-top: 4px solid var(--club, var(--acc));
  border-radius: var(--radius); padding: 14px;
}
.hh-row { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%; background: var(--card);
  border: 3px solid var(--acc); display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px; flex-shrink: 0;
}
.hh-main { flex: 1; min-width: 0; }
.hh-main h1 { margin: 0; font-size: 19px; }
.hh-main .sub { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.hh-money { text-align: right; }
.hh-money b { color: var(--gold); font-size: 17px; display: block; }
.hh-money span { color: var(--dim); font-size: 12px; }
.stars { margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.st { color: #33415a; font-size: 15px; }
.st.on { color: var(--gold); }
.star-prog { flex: 0 0 52px; height: 5px; background: #243248; border-radius: 4px; overflow: hidden; }
.star-prog i { display: block; height: 100%; background: var(--gold); }

.meters-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.meter .m-top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim); margin-bottom: 3px; }
.meter .m-top b { color: var(--txt); }
.bar { height: 7px; background: #0e1624; border-radius: 5px; overflow: hidden; }
.fill { height: 100%; border-radius: 5px; background: var(--acc); transition: width .4s ease; }

.match-card { text-align: center; }
.mc-teams { display: flex; justify-content: space-around; align-items: center; margin-bottom: 8px; }
.mc-team { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 17px; }
.mc-team small { color: var(--dim); }
.mc-vs { color: var(--dim); font-size: 11px; display: flex; flex-direction: column; gap: 2px; }
.mc-vs b { font-size: 15px; color: var(--txt); }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; }
.big-chip { width: 34px; height: 34px; border-radius: 10px; box-shadow: inset 0 -4px rgba(0,0,0,.25); }
.duties { color: var(--dim); font-size: 12px; margin-bottom: 12px; }

.slots { color: var(--acc); letter-spacing: 2px; font-size: 13px; }
.train-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.train-btn {
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 6px;
  color: var(--txt); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.train-btn:hover { border-color: var(--acc); }
.train-btn:disabled { opacity: .4; }
.train-btn .t-ico { font-size: 19px; }
.train-btn b { font-size: 12px; }
.train-btn .t-val { font-size: 16px; font-weight: 800; color: var(--acc2); }
.train-btn small { color: var(--acc); font-size: 11px; font-weight: 700; }
.train-btn.alt small { color: var(--dim); font-weight: 400; font-size: 9.5px; line-height: 1.25; }

.nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.news-card .news-line { padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.35; }
.news-card .news-line:first-of-type { border-top: none; }
.news-line small { color: var(--dim); margin-right: 6px; }

.callup { border-color: var(--gold); background: linear-gradient(160deg, #2a2410, var(--card)); }

/* ---------- post match ---------- */
.pm-head { border-radius: var(--radius); padding: 18px; text-align: center; border: 1px solid var(--line); }
.pm-head.win { background: linear-gradient(160deg, #11331d, var(--card)); border-color: #1d5c33; }
.pm-head.loss { background: linear-gradient(160deg, #391518, var(--card)); border-color: #5c2a31; }
.pm-head.draw { background: linear-gradient(160deg, #2a2a14, var(--card)); }
.pm-verdict { font-size: 13px; letter-spacing: 3px; color: var(--dim); font-weight: 800; }
.pm-score { font-size: 21px; margin: 8px 0; display: flex; justify-content: center; gap: 14px; align-items: baseline; }
.pm-score b { font-size: 34px; }
.pm-rating { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pm-rating small { color: var(--dim); }
.rating-circle {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; border: 3px solid;
}
.rating-circle.great { border-color: var(--acc); color: var(--acc); background: rgba(61,220,104,.08); }
.rating-circle.ok { border-color: var(--gold); color: var(--gold); }
.rating-circle.poor { border-color: var(--bad); color: var(--bad); }
.pm-stats { display: flex; justify-content: space-around; text-align: center; }
.pm-stats b { font-size: 19px; display: block; }
.pm-stats small { color: var(--dim); font-size: 11.5px; }
.ev-line { padding: 5px 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.ev-line:first-of-type { border-top: none; }

.interview .iv-q { font-style: italic; color: var(--dim); margin: 4px 0 10px; }
.iv-btn { display: block; width: 100%; margin-bottom: 8px; background: var(--card2); color: var(--txt); border: 1px solid var(--line); text-align: left; font-weight: 600; font-size: 14px; }
.iv-btn:hover { border-color: var(--acc); }
.iv-done { font-style: italic; color: var(--txt); }
.iv-fx { color: var(--acc); font-weight: 700; font-size: 14px; }

/* ---------- offers / shop / table ---------- */
.offer .offer-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.offer .pm-stats { margin-bottom: 12px; }
.shop-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.shop-row:first-of-type, .card .shop-row:nth-child(2) { border-top: none; }
.shop-row small { color: var(--dim); line-height: 1.3; }
.shop-row.owned { opacity: 1; }
.own-tag { color: var(--acc); font-weight: 800; font-size: 12px; letter-spacing: 1px; flex-shrink: 0; }
.own-tag.dim { color: var(--dim); }
.req { letter-spacing: 1px; }
.req .st { font-size: 11px; }

.tbl-row { display: grid; grid-template-columns: 22px 18px 1fr 36px; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tbl-row.wide { grid-template-columns: 22px 18px 1fr 28px 32px 36px; }
.tbl-row.head { color: var(--dim); font-size: 11.5px; border-top: none; }
.tbl-row:first-of-type { border-top: none; }
.tbl-row.me { background: rgba(61,220,104,.08); border-radius: 8px; padding-left: 4px; margin-left: -4px; }
.tbl-row.me .tbl-name { color: var(--acc); font-weight: 800; }
.tbl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-row b { text-align: right; }

/* ---------- toast / modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: var(--card2); border: 1px solid var(--acc); color: var(--txt);
  border-radius: 12px; padding: 11px 20px; font-weight: 700; font-size: 14.5px;
  opacity: 0; transition: all .3s ease; z-index: 60; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(5,9,16,.75); display: flex; align-items: center; justify-content: center; z-index: 70; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(360px, 88vw); }
.modal h3 { margin-top: 0; }

/* ---------- match screen ---------- */
#match-screen { position: fixed; inset: 0; z-index: 40; background: #0a0f1a; }
#pitch { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
#match-hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: linear-gradient(180deg, rgba(6,10,18,.92), rgba(6,10,18,0));
  font-weight: 700; font-size: 15px; pointer-events: none;
}
#hud-score b { margin: 0 6px; font-size: 17px; }
#hud-minute { background: var(--card2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; }
#hud-line { color: var(--dim); font-size: 13.5px; }
#commentary {
  position: absolute; bottom: 0; left: 0; right: 0; text-align: center;
  padding: 14px 18px 20px; color: #d7e1ec; font-size: 14.5px; font-style: italic;
  background: linear-gradient(0deg, rgba(6,10,18,.92), rgba(6,10,18,0)); pointer-events: none;
}
#moment-banner {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  background: rgba(12,19,34,.94); border: 1px solid var(--acc); border-radius: 14px;
  padding: 14px 22px; text-align: center; max-width: 86vw; pointer-events: none;
  animation: bannerIn .35s ease;
}
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) scale(.85); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
#moment-banner .b-min { color: var(--acc); font-size: 12px; font-weight: 900; letter-spacing: 2px; margin-bottom: 4px; }
#moment-banner .b-txt { font-size: 17px; font-weight: 700; }
#big-text {
  position: absolute; top: 38%; left: 0; right: 0; text-align: center;
  font-size: 54px; font-weight: 900; letter-spacing: 2px; pointer-events: none;
  text-shadow: 0 4px 24px rgba(0,0,0,.6);
}
#big-text.big-show { animation: bigPop .5s cubic-bezier(.2,1.6,.4,1); }
#big-text.goal { color: var(--acc); }
#big-text.mid { color: var(--gold); }
#big-text.bad { color: var(--bad); }
@keyframes bigPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
#skip-hint { position: absolute; bottom: 58px; width: 100%; text-align: center; color: var(--dim); font-size: 12px; pointer-events: none; }

@media (max-width: 420px) {
  .flag-grid { grid-template-columns: repeat(4, 1fr); }
  .meters-row { gap: 5px; }
  .meter .m-top span { font-size: 9px; }
  #big-text { font-size: 40px; }
}
