35370c81f8
FastAPI backend: - /api/players — search/filter 505 Serie A players with calibrated prices - /api/player/name — full detail with ML predictions (quantile P10/P50/P90, starter probability, bandit bid recommendation, opponent bid estimate) - /api/roster — CRUD for live auction roster with budget tracking - /api/stats — league-wide price distribution - All ML models loaded on startup (quantile, survival, bandit, opponent, budget) PWA frontend: - Installable on iOS/Android via manifest.json + service worker - Dark theme matching Fantabeto design system - Player search with role filter, quick-scan list - Detail sheet with ML intelligence cards - One-tap bid buttons (market, ML rec, max) - Live budget bar, roster management - Works offline for cached assets - Mobile-first (480px max-width) Launch: uvicorn pwa.api:app --port 8601 Live at: http://localhost:8601
209 lines
9.7 KiB
CSS
209 lines
9.7 KiB
CSS
:root {
|
|
--bg: #0B0F17;
|
|
--card: #111827;
|
|
--border: #1F2937;
|
|
--text: #E5E7EB;
|
|
--muted: #9CA3AF;
|
|
--green: #00D084;
|
|
--gold: #FFC94D;
|
|
--red: #FF4D5E;
|
|
--sky: #38BDF8;
|
|
--violet: #A78BFA;
|
|
--white: #FFF;
|
|
--gk: #E74C3C;
|
|
--def: #3498DB;
|
|
--mid: #2ECC71;
|
|
--fwd: #F39C12;
|
|
--radius: 12px;
|
|
--font: 'Inter', -apple-system, sans-serif;
|
|
--mono: 'JetBrains Mono', monospace;
|
|
}
|
|
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
body {
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
font-family: var(--font);
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
/* ── Layout ──────────────────────────────────────────────── */
|
|
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
|
|
|
|
/* ── Header ──────────────────────────────────────────────── */
|
|
header {
|
|
background: var(--card);
|
|
border-bottom: 1px solid var(--border);
|
|
padding: 12px 16px;
|
|
position: sticky; top: 0; z-index: 10;
|
|
backdrop-filter: blur(12px);
|
|
}
|
|
header h1 { font-size: 18px; font-weight: 700; }
|
|
header h1 span { color: var(--green); }
|
|
|
|
/* ── Budget bar ───────────────────────────────────────────── */
|
|
.budget-bar {
|
|
margin: 8px 0;
|
|
display: flex; gap: 8px; align-items: center;
|
|
}
|
|
.budget-bar .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
|
|
.budget-bar .value { font-family: var(--mono); font-size: 20px; font-weight: 700; }
|
|
.budget-bar .progress {
|
|
flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
|
|
}
|
|
.budget-bar .progress-fill {
|
|
height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s;
|
|
}
|
|
|
|
/* ── Tabs ─────────────────────────────────────────────────── */
|
|
.tabs {
|
|
display: flex; gap: 0; border-bottom: 1px solid var(--border);
|
|
padding: 0 16px; background: var(--card); position: sticky; top: 60px; z-index: 9;
|
|
}
|
|
.tab {
|
|
flex: 1; text-align: center; padding: 10px 4px;
|
|
border: none; background: none; color: var(--muted);
|
|
font-family: var(--font); font-size: 12px; font-weight: 600;
|
|
border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s;
|
|
}
|
|
.tab.active { color: var(--green); border-bottom-color: var(--green); }
|
|
|
|
/* ── Search ───────────────────────────────────────────────── */
|
|
.search-bar {
|
|
margin: 8px 16px; display: flex; gap: 6px;
|
|
}
|
|
.search-bar input {
|
|
flex: 1; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border);
|
|
background: var(--card); color: var(--text); font-size: 14px; outline: none;
|
|
}
|
|
.search-bar input:focus { border-color: var(--sky); }
|
|
.search-bar select {
|
|
padding: 10px 8px; border-radius: var(--radius); border: 1px solid var(--border);
|
|
background: var(--card); color: var(--text); font-size: 13px; cursor: pointer;
|
|
}
|
|
|
|
/* ── Player cards ──────────────────────────────────────────── */
|
|
.player-list { flex: 1; overflow-y: auto; padding: 0 16px 80px; }
|
|
.player-card {
|
|
background: var(--card); border: 1px solid var(--border);
|
|
border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
|
|
cursor: pointer; transition: border-color 0.15s; display: flex; gap: 10px; align-items: center;
|
|
}
|
|
.player-card:hover { border-color: var(--sky); }
|
|
.player-card.selected { border-color: var(--green); background: rgba(0,208,132,0.05); }
|
|
|
|
.role-badge {
|
|
width: 36px; height: 36px; border-radius: 8px; display: flex;
|
|
align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
|
|
color: white; flex-shrink: 0;
|
|
}
|
|
.role-badge.P { background: var(--gk); }
|
|
.role-badge.D { background: var(--def); }
|
|
.role-badge.C { background: var(--mid); }
|
|
.role-badge.A { background: var(--fwd); }
|
|
|
|
.player-info { flex: 1; min-width: 0; }
|
|
.player-name { font-weight: 600; font-size: 14px; }
|
|
.player-team { font-size: 11px; color: var(--muted); }
|
|
.player-stats { display: flex; gap: 12px; margin-top: 2px; font-size: 11px; color: var(--muted); }
|
|
.player-stats strong { color: var(--text); font-family: var(--mono); }
|
|
|
|
.player-price { text-align: right; flex-shrink: 0; }
|
|
.player-price .amt { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--gold); }
|
|
.player-price .label { font-size: 10px; color: var(--muted); }
|
|
|
|
/* ── Player detail sheet ───────────────────────────────────── */
|
|
.detail-overlay {
|
|
position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 20;
|
|
display: flex; align-items: flex-end; justify-content: center;
|
|
}
|
|
.detail-sheet {
|
|
background: var(--card); border-radius: var(--radius) var(--radius) 0 0;
|
|
width: 100%; max-width: 480px; max-height: 85dvh; overflow-y: auto;
|
|
padding: 20px 16px; animation: slideUp 0.2s ease;
|
|
}
|
|
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
|
|
|
|
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
|
|
.detail-close { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; }
|
|
|
|
.ml-card {
|
|
background: rgba(167,139,250,0.08); border: 1px solid var(--border);
|
|
border-radius: 8px; padding: 12px; margin-bottom: 8px;
|
|
}
|
|
.ml-card .title { font-size: 10px; color: var(--violet); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
|
|
.ml-card .row { display: flex; justify-content: space-between; font-size: 13px; }
|
|
.ml-card .val { font-family: var(--mono); font-weight: 600; }
|
|
|
|
.bid-row { display: flex; gap: 8px; margin-top: 12px; }
|
|
.bid-row input {
|
|
flex: 1; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border);
|
|
background: var(--card); color: var(--text); font-size: 20px; font-family: var(--mono);
|
|
text-align: center; outline: none;
|
|
}
|
|
.bid-row input:focus { border-color: var(--green); }
|
|
.bid-row button {
|
|
padding: 12px 24px; border-radius: var(--radius); border: none;
|
|
background: var(--green); color: var(--bg); font-weight: 700; font-size: 14px;
|
|
cursor: pointer; transition: opacity 0.15s;
|
|
}
|
|
.bid-row button:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
.bid-row button.danger { background: var(--red); }
|
|
|
|
.bid-quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
|
|
.bid-quick button {
|
|
padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
|
|
background: var(--card); color: var(--text); font-size: 12px; cursor: pointer;
|
|
}
|
|
.bid-quick button.active { border-color: var(--green); background: rgba(0,208,132,0.1); color: var(--green); }
|
|
.bid-quick button.over { border-color: var(--red); background: rgba(255,77,94,0.1); color: var(--red); }
|
|
|
|
/* ── Roster ─────────────────────────────────────────────────── */
|
|
.roster-section { margin-bottom: 8px; }
|
|
.roster-section h3 {
|
|
font-size: 12px; color: var(--muted); text-transform: uppercase;
|
|
letter-spacing: 0.5px; margin-bottom: 4px;
|
|
}
|
|
.roster-player {
|
|
display: flex; align-items: center; gap: 8px; padding: 6px 0;
|
|
border-bottom: 1px solid var(--border); font-size: 13px;
|
|
}
|
|
.roster-player .name { flex: 1; font-weight: 500; }
|
|
.roster-player .price { font-family: var(--mono); color: var(--gold); font-size: 12px; }
|
|
.roster-player .remove {
|
|
background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; padding: 2px 6px;
|
|
}
|
|
|
|
/* ── Stats ──────────────────────────────────────────────────── */
|
|
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 16px; }
|
|
.stat-card {
|
|
background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
|
|
padding: 12px; text-align: center;
|
|
}
|
|
.stat-card .num { font-size: 22px; font-family: var(--mono); font-weight: 700; }
|
|
.stat-card .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
|
|
|
|
/* ── Toast ──────────────────────────────────────────────────── */
|
|
.toast {
|
|
position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 30;
|
|
background: var(--green); color: var(--bg); padding: 10px 20px; border-radius: 20px;
|
|
font-weight: 600; font-size: 13px; animation: fadeIn 0.2s;
|
|
}
|
|
.toast.error { background: var(--red); color: white; }
|
|
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
|
|
|
|
/* ── Empty state ────────────────────────────────────────────── */
|
|
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
|
|
|
|
/* ── Server indicator ───────────────────────────────────────── */
|
|
.ping { font-size: 10px; color: var(--green); text-align: center; padding: 4px; }
|
|
.ping.offline { color: var(--red); }
|
|
|
|
/* ── Responsive ─────────────────────────────────────────────── */
|
|
@media (min-width: 480px) {
|
|
.app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
|
|
}
|