:root {
    --bg: #050810;
    --bg2: #0a1020;
    --surface: rgba(15, 23, 42, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --txt: #f8fafc;
    --muted: #94a3b8;
    --accent: #22c55e;
    --accent2: #2dd4bf;
    --gold: #f5c542;
    --radius: 18px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--txt);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

#app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 45% at 50% 20%, rgba(34, 197, 94, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 50% 35% at 80% 70%, rgba(245, 197, 66, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #0a1020 0%, #070b14 45%, #050810 100%);
    pointer-events: none;
}

.screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(48px, 16vh, 112px) 20px 24px;
}

.screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.7;
    pointer-events: none;
}

.screen.is-hidden {
    display: none;
}

.splash-inner {
    position: relative;
    z-index: 1;
    width: min(100%, 360px);
    text-align: center;
    animation: splash-in 0.55s ease-out both;
}

.splash-glow {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 220px;
    height: 220px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(34, 197, 94, 0.22) 0%, rgba(245, 197, 66, 0.08) 40%, transparent 70%);
    filter: blur(8px);
    animation: splash-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
}

.splash-logo {
    position: relative;
    z-index: 1;
    width: 136px;
    height: 136px;
    object-fit: contain;
    margin: 0 auto 18px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
    animation: splash-logo 2.2s ease-in-out infinite;
}

.splash-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

.splash-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #fff 25%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.splash-progress-bar {
    height: 100%;
    width: 38%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
    background-size: 200% 100%;
    animation: splash-progress 1.35s ease-in-out infinite;
}

.splash-status {
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 500;
    min-height: 1.4em;
}

.blocked-card {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    text-align: center;
    padding: 32px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    animation: splash-in 0.45s ease-out both;
}

.blocked-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    line-height: 1;
}

.blocked-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.blocked-card p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.blocked-card code {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--accent2);
    font-size: 0.82rem;
}

#app {
    position: relative;
    z-index: 10;
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    min-height: 100vh;
}

#app.is-hidden {
    display: none;
}

.app-header {
    text-align: center;
    padding: 32px 0 24px;
    animation: app-in 0.65s ease-out both;
}

.app-logo-wrap {
    width: 118px;
    height: 118px;
    margin: 0 auto 16px;
    animation: logo-reveal 0.8s ease-out 0.1s both;
}

.app-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 28px rgba(34, 197, 94, 0.25));
}

.app-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}

.app-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.2;
}

.user-inline {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    max-width: 360px;
    margin: 0 auto;
    padding: 0 4px;
    animation: app-in 0.65s ease-out 0.12s both;
}

.user-inline-name {
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--txt);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-inline-sep {
    color: rgba(148, 163, 184, 0.45);
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1;
}

.user-inline-id {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.app-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 28px 0 20px;
    padding: 5px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    animation: app-in 0.65s ease-out 0.18s both;
}

.app-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.app-tab:hover {
    color: var(--txt);
}

.app-tab.is-active {
    color: var(--txt);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.08));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tab-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(245, 197, 66, 0.18);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 20px;
}

.tab-panel {
    display: none;
    animation: app-in 0.4s ease-out both;
}

.tab-panel.is-active {
    display: block;
}

.tab-panel[hidden] {
    display: none !important;
}

.demo-note {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
    animation: app-in 0.65s ease-out 0.25s both;
}

.section-block {
    margin-top: 24px;
    animation: app-in 0.65s ease-out both;
}

.match-list {
    display: grid;
    gap: 16px;
}

.match-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(18, 28, 48, 0.96) 0%, rgba(10, 16, 30, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.match-card--active::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent2));
    opacity: 0.85;
}

.match-card--active {
    padding: 0;
}

.match-card--history {
    padding: 16px;
    opacity: 0.98;
}

.match-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px 0;
}

.match-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #86efac;
}

.match-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: live-pulse 1.8s ease-out infinite;
}

.match-window {
    font-size: 0.72rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.match-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 18px;
}

.match-scoreboard--compact {
    padding: 0 0 14px;
    gap: 10px;
}

.match-team-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.match-team-block--home {
    align-items: flex-end;
    text-align: right;
}

.match-team-block--away {
    align-items: flex-start;
    text-align: left;
}

.match-scoreboard--compact .match-team-block {
    align-items: center;
    text-align: center;
}

.team-flag {
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.85;
}

.team-name {
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.match-scoreboard--compact .team-name {
    font-size: 0.92rem;
    font-weight: 700;
}

.match-vs-ring {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(245, 197, 66, 0.22), rgba(245, 197, 66, 0.06));
    border: 1px solid rgba(245, 197, 66, 0.28);
    box-shadow: 0 0 24px rgba(245, 197, 66, 0.08);
}

.match-vs-ring--sm {
    width: 36px;
    height: 36px;
}

.match-vs-ring span {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--gold);
}

.match-card-body {
    padding: 0 18px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(0, 0, 0, 0.14);
}

.prediction-options {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    margin-bottom: 14px;
}

.prediction-btn {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.025);
    color: var(--txt);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.prediction-btn:hover {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.07);
    transform: translateY(-1px);
}

.prediction-btn.is-selected {
    border-color: rgba(34, 197, 94, 0.65);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.08));
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2), 0 8px 20px rgba(34, 197, 94, 0.1);
}

.prediction-code {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.88rem;
    background: rgba(245, 197, 66, 0.12);
    color: var(--gold);
    border: 1px solid rgba(245, 197, 66, 0.22);
}

.prediction-btn.is-selected .prediction-code {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.35);
}

.prediction-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.match-actions {
    display: flex;
    justify-content: stretch;
}

.btn-save {
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #34d399, var(--accent), #16a34a);
    color: #041008;
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.22);
}

.btn-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(34, 197, 94, 0.28);
}

.btn-save:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
}

.match-locked {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 0 4px;
}

.match-locked-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: #86efac;
    font-weight: 800;
    font-size: 1rem;
}

.match-locked-text {
    flex: 1;
    min-width: 140px;
}

.history-body {
    padding-top: 2px;
}

.locked-label,
.history-pick,
.history-result {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.locked-value,
.history-pick strong,
.history-result strong {
    font-size: 0.95rem;
    color: var(--txt);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 700;
}

.history-body .status-badge {
    margin-top: 12px;
}

.status-badge {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-pending {
    color: #fde68a;
    background: rgba(245, 197, 66, 0.14);
    border: 1px solid rgba(245, 197, 66, 0.28);
}

.status-won {
    color: #86efac;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.status-lost {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.empty-state {
    padding: 28px 20px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 500;
    max-width: min(92vw, 420px);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.toast--success {
    background: rgba(22, 163, 74, 0.95);
    color: #ecfdf5;
}

.toast--error {
    background: rgba(220, 38, 38, 0.95);
    color: #fef2f2;
}

.toast--info {
    background: rgba(15, 23, 42, 0.96);
    color: var(--txt);
    border: 1px solid var(--border);
}

@keyframes splash-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes splash-pulse {
    0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

@keyframes splash-logo {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

@keyframes splash-progress {
    0%   { transform: translateX(-120%); background-position: 0% 50%; }
    100% { transform: translateX(320%); background-position: 100% 50%; }
}

@keyframes app-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes logo-reveal {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
