/* WM Tippspiel 2026 – mobile-first App-Styles (helles Design) */

.wmt-app, .wmt-app * { box-sizing: border-box; margin: 0; padding: 0; }

.wmt-app {
	--bg: #f4f6fb;
	--bg2: #eef1f8;
	--card: #ffffff;
	--card2: #eef2f9;
	--line: #e2e8f0;
	--text: #0f172a;
	--muted: #5b6b81;
	--accent: #16a34a;
	--accent2: #15803d;
	--accent-soft: #e8f8ee;
	--gold: #b45309;
	--red: #dc2626;
	--radius: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	min-height: 100dvh;
	max-width: 520px;
	margin: 0 auto;
	position: relative;
	line-height: 1.5;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

.wmt-app input, .wmt-app button { font-family: inherit; }

/* ---------- Spinner / Boot ---------- */
.wmt-boot { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.wmt-spinner {
	width: 38px; height: 38px; border-radius: 50%;
	border: 3px solid var(--line); border-top-color: var(--accent);
	animation: wmt-spin .8s linear infinite;
}
@keyframes wmt-spin { to { transform: rotate(360deg); } }

/* ---------- Auth ---------- */
.wmt-auth { padding: 36px 22px 60px; }
.wmt-auth.wmt-center {
	min-height: 72vh; min-height: 72dvh;
	display: flex; flex-direction: column; justify-content: center;
}
.wmt-hero { text-align: center; margin-bottom: 28px; }
.wmt-hero-ball { font-size: 56px; line-height: 1; }
.wmt-logo {
	width: 104px; height: 104px; border-radius: 24px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}
.wmt-hero h1 { font-size: 27px; font-weight: 800; margin-top: 12px; letter-spacing: -.02em; color: var(--text); }
.wmt-hero p { color: var(--muted); font-size: 15px; margin-top: 8px; }
.wmt-hero .wmt-flags { font-size: 22px; margin-top: 6px; letter-spacing: 4px; }

.wmt-invite-banner {
	background: var(--accent-soft);
	border: 1px solid #b5e6c8;
	border-radius: var(--radius);
	padding: 14px 16px; margin-bottom: 20px;
	font-size: 14.5px; text-align: center; color: var(--text);
}
.wmt-invite-banner strong { color: var(--accent2); }

.wmt-field { margin-bottom: 14px; }
.wmt-field label { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 6px; font-weight: 700; }
.wmt-field input {
	width: 100%; padding: 14px 16px; font-size: 16px;
	background: var(--card); color: var(--text);
	border: 1.5px solid #cbd5e1; border-radius: 12px;
	outline: none; transition: border-color .15s;
}
.wmt-field input::placeholder { color: #9aa8bc; }
.wmt-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.wmt-field input.ok { border-color: #4ade80; }
.wmt-field input.bad { border-color: #f87171; }
.wmt-nick-state { font-size: 12.5px; font-weight: 700; margin-top: 5px; min-height: 16px; color: var(--muted); }
.wmt-nick-state.ok { color: var(--accent2); }
.wmt-nick-state.bad { color: #b91c1c; }

.wmt-btn {
	display: block; width: 100%; padding: 15px; margin-top: 8px;
	font-size: 16px; font-weight: 800; text-align: center;
	background: linear-gradient(135deg, #22c55e, var(--accent2));
	color: #fff; border: none; border-radius: 12px; cursor: pointer;
	box-shadow: 0 6px 18px rgba(22, 163, 74, .3);
	transition: transform .1s, opacity .15s;
}
.wmt-btn:active { transform: scale(.98); }
.wmt-btn[disabled] { opacity: .55; }
.wmt-btn-ghost {
	background: var(--card); color: var(--accent2);
	border: 1.5px solid #b5e6c8; box-shadow: none;
}
.wmt-btn-wa { background: linear-gradient(135deg, #25d366, #1faa52); color: #fff; }

.wmt-hint { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 14px; }
.wmt-hint a { color: var(--accent2); font-weight: 700; cursor: pointer; }

.wmt-switch { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--muted); }
.wmt-switch a { color: var(--accent2); font-weight: 800; text-decoration: none; cursor: pointer; }
.wmt-help-links { margin-top: 10px; font-size: 13px; }
.wmt-help-links a { font-weight: 700; color: var(--muted); text-decoration: underline; }
.wmt-help-links .dot { margin: 0 8px; }

.wmt-error {
	background: #fdecec; border: 1px solid #f5b5b5;
	color: #b91c1c; border-radius: 12px; padding: 12px 14px;
	font-size: 14px; font-weight: 600; margin-bottom: 14px; display: none;
}
.wmt-error.show { display: block; }

/* ---------- App-Layout ---------- */
.wmt-main { padding: 0 14px 96px; }

.wmt-topbar {
	position: sticky; top: 0; z-index: 30;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
	padding: 14px; margin: 0 -14px 4px;
	display: flex; align-items: center; justify-content: space-between;
	border-bottom: 1px solid var(--line);
}
.wmt-topbar-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); }
.wmt-topbar-title span.wmt-ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmt-topbar-sub { font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wmt-logout { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 6px; }

/* ---------- Tabs (Bottom-Navigation) ---------- */
.wmt-tabbar {
	position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
	width: 100%; max-width: 520px; z-index: 40;
	display: flex;
	background: rgba(255, 255, 255, .97);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-top: 1px solid var(--line);
	box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
	padding-bottom: env(safe-area-inset-bottom, 0);
}
.wmt-tab {
	flex: 1; padding: 10px 0 12px; text-align: center;
	background: none; border: none; cursor: pointer;
	color: var(--muted); font-size: 11.5px; font-weight: 800;
}
.wmt-tab .wmt-tab-ico { display: block; font-size: 22px; margin-bottom: 2px; filter: grayscale(1) opacity(.55); transition: filter .15s; }
.wmt-tab.active { color: var(--accent2); }
.wmt-tab.active .wmt-tab-ico { filter: none; }

/* ---------- Spiele ---------- */
.wmt-stage-title {
	font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
	color: var(--gold); margin: 22px 2px 4px;
}
.wmt-day {
	position: sticky; top: 62px; z-index: 20;
	font-size: 13.5px; font-weight: 800; color: var(--muted);
	background: rgba(244, 246, 251, .96);
	padding: 10px 2px 6px; margin: 6px -2px 2px;
}
.wmt-match {
	background: var(--card); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 10px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}
.wmt-match-meta {
	display: flex; justify-content: space-between; align-items: center;
	font-size: 11.5px; color: var(--muted); margin-bottom: 10px; font-weight: 700;
}
.wmt-match-meta .wmt-lock { color: var(--red); }
.wmt-match-meta .wmt-pts { color: var(--accent2); font-weight: 800; }

.wmt-row { display: flex; align-items: center; gap: 10px; }
.wmt-team { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.wmt-team.away { flex-direction: row-reverse; text-align: right; }
.wmt-flag { font-size: 30px; line-height: 1; flex-shrink: 0; }
.wmt-flag-q {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: 50%;
	background: var(--card2); color: var(--muted);
	font-size: 15px; font-weight: 800; flex-shrink: 0;
}
.wmt-team-name { font-size: 14.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.wmt-team-name.placeholder { color: var(--muted); font-weight: 600; font-size: 12.5px; }

.wmt-score { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.wmt-score input {
	width: 46px; height: 46px; text-align: center;
	font-size: 19px; font-weight: 800;
	background: var(--card); color: var(--text);
	border: 1.5px solid #cbd5e1; border-radius: 12px;
	outline: none; -moz-appearance: textfield; appearance: textfield;
}
.wmt-score input::-webkit-outer-spin-button, .wmt-score input::-webkit-inner-spin-button { -webkit-appearance: none; }
.wmt-score input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.wmt-score input.saved { border-color: #86d9a8; background: var(--accent-soft); }
.wmt-score .sep { color: var(--muted); font-weight: 800; }
.wmt-score-final {
	min-width: 64px; text-align: center; font-size: 20px; font-weight: 800;
	background: var(--card2); border-radius: 12px; padding: 9px 10px; color: var(--text);
	display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
}
.wmt-score-final.tappable { cursor: pointer; }
.wmt-score-final.tappable:active { background: #e2e9f4; }
.wmt-dur { font-size: 10.5px; font-weight: 800; color: var(--gold); }
.wmt-score-hint { font-size: 10px; font-weight: 800; color: var(--accent2); letter-spacing: .03em; }

.wmt-trend { margin-top: 10px; }
.wmt-trend-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--card2); }
.wmt-trend-bar .h { background: #22c55e; }
.wmt-trend-bar .d { background: #94a3b8; }
.wmt-trend-bar .a { background: #3b82f6; }
.wmt-trend-legend { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 10.5px; font-weight: 700; }
.wmt-trend-legend .th { color: #15803d; }
.wmt-trend-legend .td { color: var(--muted); }
.wmt-trend-legend .ta { color: #2563eb; }

.wmt-goals { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.wmt-goal { font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 2px 0; }
.wmt-goal.away { text-align: right; }
.wmt-goal.pens { text-align: center; color: var(--gold); margin-top: 4px; }
.wmt-goal small { font-weight: 600; }

.wmt-mytip-locked { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 8px; font-weight: 600; }
.wmt-mytip-locked b { color: var(--text); }

.wmt-match-foot {
	display: flex; justify-content: space-between; align-items: center;
	margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.wmt-save-state { font-size: 12px; color: var(--muted); min-height: 16px; font-weight: 600; }
.wmt-save-state.ok { color: var(--accent2); font-weight: 800; }
.wmt-tips-toggle {
	background: none; border: none; color: var(--muted);
	font-size: 12.5px; font-weight: 800; cursor: pointer; padding: 4px 0;
}
.wmt-tips-toggle:active { color: var(--accent2); }

.wmt-tips-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.wmt-tips-title { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 2px 2px 4px; }
.wmt-tips-list .wmt-tip-row {
	display: flex; justify-content: space-between; align-items: center;
	padding: 7px 2px; font-size: 14px; border-bottom: 1px solid var(--line);
}
.wmt-tips-list .wmt-tip-row:last-child { border-bottom: none; }
.wmt-tip-row .name { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.wmt-tip-row .name.me { color: var(--accent2); }
.wmt-tip-row .val { font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--text); }
.wmt-tip-row .val .p { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.wmt-tip-row .val .p.win { background: var(--accent-soft); color: var(--accent2); }
.wmt-tip-row .nodata { color: #9aa8bc; font-weight: 600; font-size: 13px; }

/* ---------- Rangliste ---------- */
.wmt-seg {
	display: flex; gap: 4px; margin-top: 14px;
	background: var(--card2); border: 1px solid var(--line);
	border-radius: 12px; padding: 4px;
}
.wmt-seg-btn {
	flex: 1; padding: 9px 0; font-size: 13.5px; font-weight: 800;
	background: none; border: none; border-radius: 9px;
	color: var(--muted); cursor: pointer;
}
.wmt-seg-btn.active { background: var(--card); color: var(--text); box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.wmt-board-gap { text-align: center; color: var(--muted); font-size: 18px; padding: 2px 0 8px; }
.wmt-board { margin-top: 12px; }
.wmt-board-row {
	display: flex; align-items: center; gap: 12px;
	background: var(--card); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 13px 16px; margin-bottom: 8px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}
.wmt-board-row.me { border-color: #86d9a8; background: linear-gradient(135deg, var(--accent-soft), var(--card)); }
.wmt-board-rank { width: 34px; font-size: 17px; font-weight: 800; color: var(--muted); text-align: center; flex-shrink: 0; }
.wmt-board-rank.medal { font-size: 24px; }
.wmt-board-name { flex: 1; font-weight: 800; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.wmt-board-name small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.wmt-board-pts { font-size: 19px; font-weight: 800; color: var(--accent2); }
.wmt-board-pts small { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- Gruppe ---------- */
.wmt-card {
	background: var(--card); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 18px 16px; margin-top: 14px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}
.wmt-card h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.wmt-card p.desc { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.wmt-invite-link {
	display: block; width: 100%;
	background: var(--bg); border: 1.5px dashed #cbd5e1; border-radius: 10px;
	color: var(--muted); font-size: 12.5px; padding: 11px 12px; margin-bottom: 10px;
	word-break: break-all; font-weight: 600;
}
.wmt-member-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--text); }
.wmt-member-row:last-child { border-bottom: none; }
.wmt-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmt-member-row .ava {
	width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
	background: var(--accent-soft);
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 14px; font-weight: 800; color: var(--accent2);
	border: 1px solid #b5e6c8;
}
.wmt-member-row .tag { font-size: 10.5px; font-weight: 800; color: var(--gold); border: 1px solid #ecc995; background: #fdf6e9; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; }
.wmt-member-remove {
	width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
	background: #fdecec; color: #b91c1c; border: 1px solid #f5b5b5;
	font-size: 13px; font-weight: 800; cursor: pointer;
}
.wmt-member-remove:active { background: #fbd5d5; }

.wmt-empty { text-align: center; padding: 48px 22px; color: var(--muted); font-size: 14.5px; font-weight: 600; }
.wmt-empty .big { font-size: 44px; margin-bottom: 10px; }

.wmt-toast {
	position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%) translateY(20px);
	background: #1f2937; color: #fff; font-size: 13.5px; font-weight: 700;
	padding: 11px 18px; border-radius: 99px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
	opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
	white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.wmt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.wmt-group-switch {
	width: 100%; margin-top: 10px; padding: 12px 14px; font-size: 15px;
	background: var(--card); color: var(--text);
	border: 1.5px solid #cbd5e1; border-radius: 12px; font-weight: 700;
}

/* ---------- Overlay: Tipp-Historie ---------- */
.wmt-overlay {
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(15, 23, 42, .45);
	display: flex; align-items: flex-end; justify-content: center;
	animation: wmt-fade .2s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wmt-sheet {
	background: var(--bg, #f4f6fb); width: 100%; max-width: 520px;
	max-height: 86vh; border-radius: 20px 20px 0 0;
	display: flex; flex-direction: column;
	box-shadow: 0 -10px 40px rgba(15, 23, 42, .25);
	animation: wmt-slide-up .28s cubic-bezier(.2, .9, .3, 1);
}
.wmt-sheet-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 18px; border-bottom: 1px solid var(--line, #e2e8f0);
	background: var(--card, #fff); border-radius: 20px 20px 0 0;
	font-size: 15.5px; color: var(--text, #0f172a);
}
.wmt-sheet-close {
	width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line, #e2e8f0);
	background: var(--card2, #eef2f9); color: var(--muted, #5b6b81); font-size: 14px; font-weight: 800; cursor: pointer;
	flex-shrink: 0; line-height: 1;
}
.wmt-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 16px 30px; }
.wmt-history-row {
	background: var(--card, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 12px;
	padding: 11px 13px; margin-top: 8px; font-size: 13.5px;
	display: flex; flex-direction: column; gap: 3px;
}
.wmt-history-row .match { font-weight: 800; color: var(--text); }
.wmt-history-row .res { color: var(--muted); font-weight: 600; }
.wmt-history-row .tip { color: var(--text); font-weight: 600; }
.wmt-history-row .p { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.wmt-history-row .p.win { background: var(--accent-soft); color: var(--accent2); }
.wmt-history-row .nodata { color: #9aa8bc; }

/* ---------- Rangliste klickbar ---------- */
.wmt-board-row.clickable { cursor: pointer; }
.wmt-board-row.clickable:active { transform: scale(.985); }
.wmt-board-arrow { color: #9aa8bc; font-size: 22px; font-weight: 700; flex-shrink: 0; }

/* ---------- Gruppen-Verwaltung ---------- */
.wmt-group-row {
	display: flex; align-items: center; gap: 10px;
	padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.wmt-group-row:last-of-type { border-bottom: none; }
.wmt-group-row .check { width: 22px; color: var(--accent2); font-weight: 900; font-size: 16px; flex-shrink: 0; }
.wmt-group-row .gname { flex: 1; font-weight: 800; font-size: 15px; color: var(--text); min-width: 0; }
.wmt-group-row .gname small { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.wmt-group-row.active .gname { color: var(--accent2); }
.wmt-icon-btn {
	width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
	background: var(--card2); border: 1px solid var(--line);
	font-size: 14px; cursor: pointer;
}
.wmt-icon-btn:active { background: #e2e9f4; }

/* ---------- Animationen ---------- */
@keyframes wmt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wmt-slide-up { from { transform: translateY(40px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes wmt-rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#wmt-view { animation: wmt-fade .22s ease; }
.wmt-match, .wmt-board-row, .wmt-card { animation: wmt-rise .3s ease both; }

@media (prefers-reduced-motion: reduce) {
	.wmt-app *, .wmt-overlay, .wmt-sheet { animation: none !important; transition: none !important; }
}

@media (min-width: 521px) {
	.wmt-app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
	.wmt-match, .wmt-board-row, .wmt-card { transition: transform .18s ease, box-shadow .18s ease; }
	.wmt-match:hover, .wmt-board-row:hover, .wmt-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .1); }
	.wmt-btn { transition: transform .15s ease, box-shadow .2s ease; }
	.wmt-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22, 163, 74, .4); }
}
