feat: Stadium Elite Design, Rangliste, Profil-Team, User-Upsert & n8n Cronjob

- MatchCard + TipModal: Uhrzeit statt VS zwischen Flaggen, Gruppe zentriert
- LeaderboardPage: Podium (2./1./3.), DU-Badge, Trend-Pfeile, Team-Zeile, CTA-Card
- AdminPage: Stadium Elite Redesign mit Result-Bar und Inline-Spinner
- ProfilePage: Team-Feld inline editierbar (PATCH /api/profile/team)
- User-Upsert beim ersten App-Aufruf (Matches-Route) statt erst beim Tipp
- DB Migration 002: team-Spalte in users, Leaderboard View aktualisiert
- Leaderboard-Refresh automatisch nach Tipps-Auswertung
- n8n Workflow angelegt: stündlicher Sync + Auswertung (ID: t3SDspIGDXwkfOt3)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ronny Mueller
2026-04-03 23:37:38 +02:00
parent e967f36f6c
commit e27a62a37b
20 changed files with 1515 additions and 297 deletions
+176 -52
View File
@@ -1,61 +1,153 @@
.card { padding: 16px 20px; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 12px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.09); }
.live { box-shadow: 0 0 0 1px rgba(248,113,113,0.3), 0 10px 25px rgba(0,0,0,0.25) !important; }
/* MatchCard — Stadium Elite Style */
.card {
padding: 20px 24px;
transition: box-shadow 0.2s, transform 0.15s;
cursor: default;
}
.card:hover {
transform: translateY(-1px);
box-shadow:
0 16px 36px rgba(0,0,0,0.35),
inset 0 1px 0 rgba(255,255,255,0.10),
inset 1px 0 0 rgba(255,255,255,0.05);
}
.live {
box-shadow:
0 0 0 1px rgba(248,113,113,0.25),
0 10px 30px rgba(248,113,113,0.08),
inset 0 1px 0 rgba(255,255,255,0.07) !important;
}
/* Top row */
.topRow {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 14px;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 18px;
}
.status {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
}
.statusLive {
color: var(--error);
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.status { font-size: 12px; color: var(--text-muted); }
.statusLive { color: var(--error); font-weight: 600; }
.kickoff { font-size: 13px; color: var(--text-secondary); margin-left: auto; }
.badge, .badgeUrgent {
font-size: 11px;
padding: 3px 8px;
border-radius: 10px;
font-weight: 600;
font-weight: 700;
padding: 3px 9px;
border-radius: 20px;
}
.badge {
background: var(--surface-high);
color: var(--text-secondary);
}
.badgeUrgent {
background: rgba(254,174,50,0.12);
color: var(--gold);
border: 1px solid rgba(254,174,50,0.2);
}
.badge { background: var(--surface-high); color: var(--text-secondary); }
.badgeUrgent { background: rgba(254,174,50,0.15); color: var(--gold); }
.group {
font-size: 11px;
font-weight: 600;
color: var(--primary);
background: var(--primary-dim);
padding: 2px 8px;
border-radius: 10px;
padding: 3px 9px;
border-radius: 20px;
border: 1px solid rgba(75,183,248,0.15);
margin-left: auto;
}
/* Match row — Teams + Score */
.matchRow {
display: grid;
grid-template-columns: 1fr auto 1fr;
grid-template-columns: 1fr 100px 1fr;
align-items: center;
gap: 16px;
margin-bottom: 16px;
gap: 12px;
margin-bottom: 18px;
}
.teamHome { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.teamAway { display: flex; align-items: center; gap: 10px; }
.crest { width: 28px; height: 28px; object-fit: contain; }
/* Teams */
.teamHome {
display: flex;
align-items: center;
gap: 12px;
justify-content: flex-end;
}
.teamAway {
display: flex;
align-items: center;
gap: 12px;
}
/* Flag box — glossy square */
.flagBox {
width: 56px;
height: 56px;
border-radius: 13px;
background: var(--surface-high);
box-shadow:
0 4px 12px rgba(0,0,0,0.3),
inset 0 1px 0 rgba(255,255,255,0.12);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
overflow: hidden;
position: relative;
}
.flagBox::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
pointer-events: none;
z-index: 1;
}
.crest {
width: 38px;
height: 38px;
object-fit: contain;
position: relative;
z-index: 0;
}
.teamName {
font-family: 'Plus Jakarta Sans', sans-serif;
font-weight: 600;
font-weight: 700;
font-size: 15px;
color: var(--text-primary);
line-height: 1.2;
}
/* Score / VS center */
.scoreBox {
min-width: 80px;
text-align: center;
background: var(--surface-high);
border-radius: var(--radius-sm);
padding: 8px 12px;
display: flex;
align-items: center;
justify-content: center;
}
.score {
@@ -63,63 +155,95 @@
font-size: 22px;
font-weight: 800;
color: var(--text-primary);
letter-spacing: 2px;
letter-spacing: 4px;
}
.vs {
font-size: 14px;
font-weight: 600;
color: var(--text-muted);
.kickoffCenter {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
/* Tipp */
.kickoffCenterTime {
font-family: 'Plus Jakarta Sans', sans-serif;
font-size: 13px;
font-weight: 800;
color: var(--primary);
white-space: nowrap;
}
/* Tipp area */
.tipRow {
border-top: 1px solid rgba(255,255,255,0.06);
padding-top: 12px;
border-top: 1px solid rgba(255,255,255,0.05);
padding-top: 14px;
display: flex;
align-items: center;
justify-content: center;
min-height: 44px;
}
.tipBtn { width: 100%; max-width: 240px; }
.tipBtn {
width: 100%;
max-width: 260px;
padding: 11px 20px;
font-size: 14px;
letter-spacing: 0.02em;
}
/* Existing tip display */
.tipDisplay {
display: flex;
align-items: center;
gap: 12px;
gap: 10px;
flex-wrap: wrap;
justify-content: center;
}
.tipLabel { font-size: 13px; color: var(--text-secondary); }
.tipLabel {
font-size: 12px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.tipScore {
font-family: 'Plus Jakarta Sans', sans-serif;
font-weight: 700;
font-size: 16px;
font-weight: 800;
font-size: 17px;
color: var(--primary);
background: var(--primary-dim);
padding: 3px 12px;
border-radius: 8px;
border: 1px solid rgba(75,183,248,0.15);
}
.points {
font-size: 13px;
font-weight: 600;
padding: 3px 10px;
border-radius: 10px;
font-size: 12px;
font-weight: 700;
padding: 4px 10px;
border-radius: 20px;
}
.exact { background: rgba(52,211,153,0.15); color: var(--success); }
.tendency { background: rgba(75,183,248,0.15); color: var(--primary); }
.wrong { background: rgba(248,113,113,0.12); color: var(--error); }
.exact { background: rgba(52,211,153,0.12); color: var(--success); border: 1px solid rgba(52,211,153,0.2); }
.tendency { background: rgba(75,183,248,0.12); color: var(--primary); border: 1px solid rgba(75,183,248,0.2); }
.wrong { background: rgba(248,113,113,0.10); color: var(--error); border: 1px solid rgba(248,113,113,0.15); }
.editBtn {
background: transparent;
border: 1px solid rgba(255,255,255,0.15);
color: var(--text-secondary);
border: 1px solid rgba(255,255,255,0.1);
color: var(--text-muted);
padding: 4px 12px;
border-radius: 6px;
border-radius: 20px;
font-size: 12px;
cursor: pointer;
transition: all 0.15s;
}
.editBtn:hover { border-color: var(--primary); color: var(--primary); }
.noTip { font-size: 13px; color: var(--text-muted); }
.noTip {
font-size: 12px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
+36 -23
View File
@@ -9,7 +9,7 @@ interface Props {
const STATUS_LABELS: Record<string, string> = {
SCHEDULED: 'Geplant',
TIMED: 'Terminiert',
IN_PLAY: '🔴 Live',
IN_PLAY: 'Live',
PAUSED: 'Pause',
FINISHED: 'Beendet',
POSTPONED: 'Verschoben',
@@ -18,20 +18,31 @@ const STATUS_LABELS: Record<string, string> = {
function formatKickoff(utcDate: string): string {
return new Date(utcDate).toLocaleString('de-DE', {
hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Berlin'
hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Berlin',
}) + ' Uhr';
}
function CountdownBadge({ minutes }: { minutes: number }) {
if (minutes <= 0) return null;
if (minutes < 60) return <span className={styles.badgeUrgent}>in {minutes} Min.</span>;
if (minutes < 60) return <span className={styles.badgeUrgent}> in {minutes} Min.</span>;
const h = Math.floor(minutes / 60);
const m = minutes % 60;
if (h < 24) return <span className={styles.badge}>in {h}h {m > 0 ? `${m}m` : ''}</span>;
if (h < 24) return <span className={styles.badge}>in {h}h{m > 0 ? ` ${m}m` : ''}</span>;
const d = Math.floor(h / 24);
return <span className={styles.badge}>in {d} Tag{d > 1 ? 'en' : ''}</span>;
}
function FlagBox({ crest, name }: { crest: string | null; name: string }) {
return (
<div className={styles.flagBox}>
{crest
? <img className={styles.crest} src={crest} alt={name} />
: <span style={{ fontSize: 18 }}>🏳</span>
}
</div>
);
}
export default function MatchCard({ match, onTip }: Props) {
const isFinished = match.status === 'FINISHED';
const isLive = match.status === 'IN_PLAY' || match.status === 'PAUSED';
@@ -39,51 +50,53 @@ export default function MatchCard({ match, onTip }: Props) {
return (
<div className={`card ${styles.card} ${isLive ? styles.live : ''}`}>
{/* Status + Kickoff */}
{/* Top row: Status / Kickoff / Badges */}
<div className={styles.topRow}>
<span className={`${styles.status} ${isLive ? styles.statusLive : ''}`}>
{STATUS_LABELS[match.status] ?? match.status}
{isLive && '● '}{STATUS_LABELS[match.status] ?? match.status}
</span>
<span className={styles.kickoff}>{formatKickoff(match.utcDate)}</span>
{match.group && (
<span className={styles.group}>
{match.group.replace('GROUP_', 'Gruppe ')}
</span>
)}
{match.tippable && <CountdownBadge minutes={match.minutesUntilKickoff} />}
{match.group && <span className={styles.group}>{match.group.replace('GROUP_', 'Gruppe ')}</span>}
</div>
{/* Teams + Score */}
<div className={styles.matchRow}>
{/* Home Team */}
{/* Home */}
<div className={styles.teamHome}>
{match.homeTeam.crest && (
<img className={styles.crest} src={match.homeTeam.crest} alt="" />
)}
<span className={styles.teamName}>{match.homeTeam.name}</span>
<FlagBox crest={match.homeTeam.crest} name={match.homeTeam.name} />
</div>
{/* Score / VS */}
{/* Score / Kickoff time */}
<div className={styles.scoreBox}>
{isFinished || isLive ? (
<span className={styles.score}>
{match.score.home ?? ''} : {match.score.away ?? ''}
{match.score.home ?? ''}&nbsp;:&nbsp;{match.score.away ?? ''}
</span>
) : (
<span className={styles.vs}>vs</span>
<div className={styles.kickoffCenter}>
<span className={styles.kickoffCenterTime}>{formatKickoff(match.utcDate)}</span>
</div>
)}
</div>
{/* Away Team */}
{/* Away */}
<div className={styles.teamAway}>
<FlagBox crest={match.awayTeam.crest} name={match.awayTeam.name} />
<span className={styles.teamName}>{match.awayTeam.name}</span>
{match.awayTeam.crest && (
<img className={styles.crest} src={match.awayTeam.crest} alt="" />
)}
</div>
</div>
{/* Tipp-Bereich */}
{/* Tipp area */}
<div className={styles.tipRow}>
{hasTip ? (
<div className={styles.tipDisplay}>
<span className={styles.tipLabel}>Dein Tipp:</span>
<span className={styles.tipLabel}>Dein Tipp</span>
<span className={styles.tipScore}>
{match.userTip!.home} : {match.userTip!.away}
</span>
@@ -93,7 +106,7 @@ export default function MatchCard({ match, onTip }: Props) {
match.userTip!.points === 1 ? styles.tendency : styles.wrong
}`}>
{match.userTip!.points === 3 ? '🎯 3 Punkte' :
match.userTip!.points === 1 ? '✓ 1 Punkt' : '✗ 0 Punkte'}
match.userTip!.points === 1 ? '✓ 1 Punkt' : '✗ 0 Punkte'}
</span>
)}
{match.tippable && (
@@ -102,7 +115,7 @@ export default function MatchCard({ match, onTip }: Props) {
</div>
) : match.tippable ? (
<button className={`btn-primary ${styles.tipBtn}`} onClick={onTip}>
Tipp abgeben
Tipp abgeben
</button>
) : (
<span className={styles.noTip}>Kein Tipp abgegeben</span>
+261 -58
View File
@@ -1,118 +1,321 @@
/* TipModal — Stadium Elite / Stitch Style */
.overlay {
position: fixed; inset: 0; z-index: 200;
background: rgba(0,0,0,0.7);
backdrop-filter: blur(8px);
display: flex; align-items: center; justify-content: center;
padding: 20px;
position: fixed;
inset: 0;
z-index: 200;
background: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(12px);
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 0;
animation: fadeIn 0.2s ease;
}
.modal {
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
/* Bottom sheet */
.sheet {
background: var(--surface-mid);
border-radius: var(--radius-xl);
padding: 28px;
width: 100%; max-width: 440px;
box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(75,183,248,0.1);
width: 100%;
max-width: 540px;
border-radius: 28px 28px 0 0;
padding: 12px 28px 36px;
box-shadow:
0 -8px 40px rgba(0,0,0,0.5),
0 0 0 1px rgba(75,183,248,0.08),
inset 0 1px 0 rgba(255,255,255,0.08);
animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
position: relative;
}
.header {
display: flex; align-items: center; justify-content: space-between;
@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
/* Glossy sheen on top of sheet */
.sheet::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0; height: 40%;
background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
border-radius: 28px 28px 0 0;
pointer-events: none;
}
/* Drag handle */
.handle {
width: 40px;
height: 4px;
background: rgba(255,255,255,0.15);
border-radius: 2px;
margin: 0 auto 20px;
}
/* Match header */
.matchHeader {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 24px;
}
.title {
font-family: 'Plus Jakarta Sans', sans-serif;
font-size: 20px; font-weight: 800;
.groupBadge {
font-size: 11px;
font-weight: 700;
color: var(--primary);
background: var(--primary-dim);
padding: 3px 10px;
border-radius: 20px;
border: 1px solid rgba(75,183,248,0.2);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.closeBtn {
background: var(--surface-high);
border: none; color: var(--text-secondary);
width: 32px; height: 32px; border-radius: 50%;
cursor: pointer; font-size: 14px;
display: flex; align-items: center; justify-content: center;
transition: all 0.15s;
}
.closeBtn:hover { background: var(--surface-high); color: var(--text-primary); }
/* Teams row */
.teamsRow {
display: flex; align-items: center; justify-content: space-between;
gap: 12px; margin-bottom: 28px;
display: grid;
grid-template-columns: 1fr 40px 1fr;
gap: 8px;
margin-bottom: 32px;
align-items: start;
}
.team { display: flex; align-items: center; gap: 8px; flex: 1; }
.teamRight { flex-direction: row-reverse; }
.teamBlock {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.crest { width: 32px; height: 32px; object-fit: contain; }
/* Large flag box */
.flagLarge {
width: 72px;
height: 72px;
border-radius: 18px;
background: var(--surface-high);
box-shadow:
0 8px 24px rgba(0,0,0,0.35),
inset 0 1px 0 rgba(255,255,255,0.12),
inset 1px 0 0 rgba(255,255,255,0.06);
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
}
.flagLarge::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
pointer-events: none;
z-index: 1;
}
.flagImg {
width: 48px;
height: 48px;
object-fit: contain;
position: relative;
z-index: 0;
}
.flagEmoji { font-size: 36px; }
.teamName {
font-family: 'Plus Jakarta Sans', sans-serif;
font-weight: 600; font-size: 14px;
font-weight: 700;
font-size: 14px;
color: var(--text-primary);
text-align: center;
line-height: 1.2;
}
.vs { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.teamShort {
font-size: 11px;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.vsBlock {
display: flex;
align-items: center;
justify-content: center;
height: 72px;
}
.kickoffBlock {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
.kickoffDate {
font-family: 'Plus Jakarta Sans', sans-serif;
font-size: 11px;
font-weight: 700;
color: var(--text-secondary);
text-align: center;
white-space: nowrap;
}
.kickoffTime {
font-family: 'Plus Jakarta Sans', sans-serif;
font-size: 12px;
font-weight: 800;
color: var(--primary);
text-align: center;
white-space: nowrap;
}
/* Picker section */
.pickerSection {
margin-bottom: 20px;
}
.pickerLabel {
text-align: center;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
margin-bottom: 16px;
}
.pickerRow {
display: flex; align-items: center; justify-content: center;
gap: 20px; margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
}
.colon {
.pickerColon {
font-family: 'Plus Jakarta Sans', sans-serif;
font-size: 40px; font-weight: 800;
font-size: 48px;
font-weight: 800;
color: var(--text-secondary);
line-height: 1;
padding-bottom: 12px;
}
/* Individual picker */
.picker {
display: flex; flex-direction: column;
align-items: center; gap: 12px;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.pickerBtn {
width: 48px; height: 48px;
width: 52px;
height: 52px;
background: var(--surface-high);
border: 1px solid rgba(255,255,255,0.1);
border-radius: var(--radius-md);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 14px;
color: var(--text-primary);
font-size: 22px; font-weight: 300;
font-size: 24px;
font-weight: 300;
cursor: pointer;
display: flex; align-items: center; justify-content: center;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.15s;
box-shadow:
0 4px 10px rgba(0,0,0,0.2),
inset 0 1px 0 rgba(255,255,255,0.08);
}
.pickerBtn:hover {
background: var(--primary-dim);
border-color: rgba(75,183,248,0.3);
color: var(--primary);
box-shadow:
0 4px 16px rgba(75,183,248,0.15),
inset 0 1px 0 rgba(75,183,248,0.1);
}
.pickerBtn:active {
transform: scale(0.94);
}
.pickerBtn:hover { background: var(--primary-dim); border-color: var(--primary); color: var(--primary); }
.pickerValue {
font-family: 'Plus Jakarta Sans', sans-serif;
font-size: 52px; font-weight: 800;
font-size: 58px;
font-weight: 800;
color: var(--text-primary);
min-width: 60px; text-align: center;
min-width: 70px;
text-align: center;
line-height: 1;
}
.tendencyRow {
display: flex; align-items: center; justify-content: center;
gap: 8px; margin-bottom: 24px;
padding: 10px;
/* Tendenz bar */
.tendencyBar {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 16px;
background: var(--surface-high);
border-radius: var(--radius-sm);
border-radius: 12px;
margin-bottom: 20px;
border: 1px solid rgba(255,255,255,0.06);
}
.tendencyLabel { font-size: 13px; color: var(--text-secondary); }
.tendencyValue { font-size: 14px; font-weight: 700; color: var(--primary); }
.tendencyIcon { font-size: 18px; }
.tendencyText {
font-size: 14px;
color: var(--text-secondary);
}
.tendencyText strong {
color: var(--tendency-color, var(--primary));
font-weight: 700;
}
/* Error */
.error {
color: var(--error);
font-size: 13px;
text-align: center;
padding: 10px 14px;
background: rgba(248,113,113,0.08);
border-radius: 10px;
margin-bottom: 16px;
padding: 10px;
background: rgba(248,113,113,0.1);
border-radius: var(--radius-sm);
border: 1px solid rgba(248,113,113,0.15);
}
.actions {
display: flex; gap: 12px; justify-content: flex-end;
/* CTA Buttons */
.saveBtn {
width: 100%;
padding: 15px;
font-size: 15px;
border-radius: 14px;
margin-bottom: 10px;
box-shadow: 0 6px 20px rgba(75,183,248,0.25);
}
.actions .btn-primary { flex: 1; }
.cancelBtn {
width: 100%;
padding: 12px;
background: transparent;
border: none;
color: var(--text-muted);
font-size: 14px;
cursor: pointer;
transition: color 0.15s;
}
.cancelBtn:hover { color: var(--text-secondary); }
+103 -34
View File
@@ -8,6 +8,14 @@ interface Props {
onSaved: (matchId: number, home: number, away: number) => void;
}
type Tendency = 'home' | 'draw' | 'away';
function getTendency(home: number, away: number): Tendency {
if (home > away) return 'home';
if (away > home) return 'away';
return 'draw';
}
export default function TipModal({ match, onClose, onSaved }: Props) {
const existing = match.userTip;
const [home, setHome] = useState(existing?.home ?? 0);
@@ -15,9 +23,15 @@ export default function TipModal({ match, onClose, onSaved }: Props) {
const [saving, setSaving] = useState(false);
const [error, setError] = useState<string | null>(null);
const adjust = (setter: React.Dispatch<React.SetStateAction<number>>, val: number, delta: number) => {
setter(Math.max(0, Math.min(20, val + delta)));
};
const tendency = getTendency(home, away);
const tendencyLabel =
tendency === 'home' ? match.homeTeam.shortName || match.homeTeam.name :
tendency === 'away' ? match.awayTeam.shortName || match.awayTeam.name :
'Unentschieden';
const tendencyColor =
tendency === 'home' ? 'var(--primary)' :
tendency === 'away' ? 'var(--cyan)' :
'var(--gold)';
const handleSave = async () => {
setSaving(true);
@@ -31,54 +45,97 @@ export default function TipModal({ match, onClose, onSaved }: Props) {
}
};
// Tendenz-Anzeige
const tendency = home > away ? match.homeTeam.shortName :
away > home ? match.awayTeam.shortName : 'Unentschieden';
return (
<div className={styles.overlay} onClick={onClose}>
<div className={styles.modal} onClick={e => e.stopPropagation()}>
{/* Header */}
<div className={styles.header}>
<h2 className={styles.title}>Tipp abgeben</h2>
<button className={styles.closeBtn} onClick={onClose}></button>
<div className={styles.sheet} onClick={e => e.stopPropagation()}>
{/* Drag handle */}
<div className={styles.handle} />
{/* Match info header */}
<div className={styles.matchHeader}>
{match.group && (
<span className={styles.groupBadge}>
{match.group.replace('GROUP_', 'Gruppe ')}
</span>
)}
</div>
{/* Teams */}
{/* Teams mit Flaggen */}
<div className={styles.teamsRow}>
<div className={styles.team}>
{match.homeTeam.crest && <img className={styles.crest} src={match.homeTeam.crest} alt="" />}
<div className={styles.teamBlock}>
<div className={styles.flagLarge}>
{match.homeTeam.crest
? <img src={match.homeTeam.crest} alt={match.homeTeam.name} className={styles.flagImg} />
: <span className={styles.flagEmoji}>🏳</span>
}
</div>
<span className={styles.teamName}>{match.homeTeam.name}</span>
<span className={styles.teamShort}>{match.homeTeam.shortName}</span>
</div>
<span className={styles.vs}>vs</span>
<div className={`${styles.team} ${styles.teamRight}`}>
<div className={styles.vsBlock}>
<div className={styles.kickoffBlock}>
<span className={styles.kickoffDate}>
{new Date(match.utcDate).toLocaleString('de-DE', {
weekday: 'short', day: 'numeric', month: 'short',
timeZone: 'Europe/Berlin'
})}
</span>
<span className={styles.kickoffTime}>
{new Date(match.utcDate).toLocaleString('de-DE', {
hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Berlin'
})} Uhr
</span>
</div>
</div>
<div className={styles.teamBlock}>
<div className={styles.flagLarge}>
{match.awayTeam.crest
? <img src={match.awayTeam.crest} alt={match.awayTeam.name} className={styles.flagImg} />
: <span className={styles.flagEmoji}>🏳</span>
}
</div>
<span className={styles.teamName}>{match.awayTeam.name}</span>
{match.awayTeam.crest && <img className={styles.crest} src={match.awayTeam.crest} alt="" />}
<span className={styles.teamShort}>{match.awayTeam.shortName}</span>
</div>
</div>
{/* Score Picker */}
<div className={styles.pickerRow}>
<ScorePicker value={home} onChange={v => setHome(v)} />
<div className={styles.colon}>:</div>
<ScorePicker value={away} onChange={v => setAway(v)} />
<div className={styles.pickerSection}>
<p className={styles.pickerLabel}>Dein Tipp</p>
<div className={styles.pickerRow}>
<ScorePicker value={home} onChange={setHome} />
<div className={styles.pickerColon}>:</div>
<ScorePicker value={away} onChange={setAway} />
</div>
</div>
{/* Tendenz */}
<div className={styles.tendencyRow}>
<span className={styles.tendencyLabel}>Tendenz:</span>
<span className={styles.tendencyValue}>{tendency}</span>
<div className={styles.tendencyBar} style={{ '--tendency-color': tendencyColor } as React.CSSProperties}>
<span className={styles.tendencyIcon}>
{tendency === 'draw' ? '🤝' : tendency === 'home' ? '🏠' : '✈️'}
</span>
<span className={styles.tendencyText}>
Tendenz: <strong>{tendencyLabel}</strong>
</span>
</div>
{error && <div className={styles.error}>{error}</div>}
{/* Buttons */}
<div className={styles.actions}>
<button className="btn-ghost" onClick={onClose}>Abbrechen</button>
<button className="btn-primary" onClick={handleSave} disabled={saving}>
{saving ? 'Wird gespeichert…' : '✓ Tipp speichern'}
</button>
</div>
{/* CTA */}
<button
className={`btn-primary ${styles.saveBtn}`}
onClick={handleSave}
disabled={saving}
>
{saving ? '⏳ Wird gespeichert…' : '✓ Tipp bestätigen'}
</button>
<button className={styles.cancelBtn} onClick={onClose}>
Abbrechen
</button>
</div>
</div>
);
@@ -87,9 +144,21 @@ export default function TipModal({ match, onClose, onSaved }: Props) {
function ScorePicker({ value, onChange }: { value: number; onChange: (v: number) => void }) {
return (
<div className={styles.picker}>
<button className={styles.pickerBtn} onClick={() => onChange(Math.min(20, value + 1))}>+</button>
<button
className={styles.pickerBtn}
onClick={() => onChange(Math.min(20, value + 1))}
aria-label="Erhöhen"
>
+
</button>
<span className={styles.pickerValue}>{value}</span>
<button className={styles.pickerBtn} onClick={() => onChange(Math.max(0, value - 1))}></button>
<button
className={styles.pickerBtn}
onClick={() => onChange(Math.max(0, value - 1))}
aria-label="Verringern"
>
</button>
</div>
);
}