:root {
    --bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --green: #22c55e;
    --green-dark: #15803d;
    --card: #ffffff;
    --border: #22c55e;
    --code-bg: #ecfdf5;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: clamp(24px, 3.5vw, 56px) clamp(16px, 3vw, 40px);
}

.container {
    width: min(92vw, 1100px);
    margin: 0 auto;
}

.top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(12px, 2vw, 24px);
    flex-wrap: wrap;
    margin-bottom: clamp(20px, 3vw, 32px);
}

.brand {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.6vw, 18px);
}

.logo {
    width: clamp(44px, 4.5vw, 64px);
    height: clamp(44px, 4.5vw, 64px);
    border-radius: 14px;
    object-fit: cover;
}

h1 {
    margin: 0;
    font-size: clamp(1.15rem, 1.55vw, 1.5rem);
    font-weight: 700;
}

.subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: clamp(0.88rem, 1.15vw, 1.05rem);
    max-width: 42rem;
    line-height: 1.45;
}

.badge {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding-top: 6px;
}

.card-panel {
    border: 2px solid var(--border);
    border-radius: 16px;
    box-shadow: 6px 6px 0 var(--green);
    background: var(--card);
    padding: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 20px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.chip {
    border: 1px solid rgba(34, 197, 94, 0.45);
    background: #f9fafb;
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
}

.chip.is-active {
    background: var(--code-bg);
    border-color: var(--green);
    color: var(--green-dark);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.field {
    display: grid;
    gap: 6px;
    min-width: 160px;
}

.field.grow {
    flex: 1 1 220px;
}

.field span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.field input,
.field select {
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0 12px;
    font: inherit;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.btn {
    min-height: 42px;
    border-radius: 10px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn.primary {
    background: var(--green);
    color: #052e16;
}

.btn.ghost {
    background: #fff;
    border-color: #d1d5db;
    color: var(--text);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.status {
    color: var(--muted);
    margin: 0 0 16px;
    min-height: 1.4em;
}

.filter-status {
    color: var(--muted);
    margin: 14px 0 0;
    min-height: 1.4em;
    font-weight: 600;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(14px, 2vw, 22px);
}

.result-card {
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 16px;
    box-shadow: 6px 6px 0 var(--green);
    padding: 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 180px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.result-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--green-dark);
}

.result-card .type-pill {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--green);
    background: var(--code-bg);
    color: var(--green-dark);
    margin-right: 6px;
}

.result-card .type-pill.live-badge {
    border-color: #fca5a5;
    background: #fee2e2;
    color: #b91c1c;
}

.result-card .type-pill.tournament-badge,
.meta-chip.tournament-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-color: #86efac;
    background: #ecfdf5;
    color: var(--green-dark);
}

.tournament-icon {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
}

.result-card.is-tournament {
    border-color: var(--green-dark);
}

.ranking-card {
    position: relative;
}

.rank-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-family: var(--mono);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--green-dark);
    background: var(--code-bg);
    border: 1px solid rgba(34, 197, 94, 0.45);
    border-radius: 999px;
    padding: 4px 10px;
}

.ranking-types {
    margin-top: 10px;
}

.result-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.result-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    flex: 1;
}

.avatar-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
}

.avatar-wrap .avatar {
    position: absolute;
    inset: 0;
}

.result-card .avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(34, 197, 94, 0.4);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.stat-cell {
    display: grid;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.stat-value {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text);
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.muted-note {
    margin: 0 !important;
    font-size: 0.85rem !important;
}

.result-card .link {
    color: var(--green-dark);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: auto;
}

.card-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.card-hero {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card-hero-text {
    display: grid;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    background: var(--code-bg);
    color: var(--green-dark);
    font-weight: 800;
    font-size: 1.2rem;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-chip {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.meta-chip.unique-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #ecfdf5;
    border-color: #86efac;
    color: var(--green-dark);
}

.unique-id-label {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.unique-id-value {
    font-size: 0.7rem;
    font-weight: 800;
}

.unique-id-action {
    display: inline-flex;
    align-items: center;
    opacity: 0.9;
}

.copy-icon {
    width: 14px;
    height: 14px;
    display: block;
}

.meta-chip.unique-id-chip.is-copied {
    background: #dcfce7;
    border-color: #22c55e;
}

.meta-chip.live-badge,
.type-pill.live-badge,
.badge.live-badge {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    animation: live-pulse 1.6s ease-in-out infinite;
}

.result-card.is-live {
    border-color: #ef4444;
    box-shadow: 6px 6px 0 rgba(239, 68, 68, 0.35);
}

@keyframes live-pulse {
    0%,
    100% { opacity: 1; }
    50% { opacity: 0.72; }
}

.verified {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--green-dark);
}

.scoreboard {
    display: grid;
    gap: 8px;
}

.scoreboard-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

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

.team-score {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.overs {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
}

.result-text {
    color: var(--green-dark) !important;
    font-weight: 700 !important;
}

.potm-text {
    font-size: 0.85rem !important;
}

.score-lines {
    display: grid;
    gap: 4px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.skeleton-card {
    pointer-events: none;
    min-height: 168px;
}

.skeleton-line,
.skeleton-block {
    border-radius: 8px;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 45%, #f3f4f6 90%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 10px;
}

.skeleton-line.w-sm { width: 28%; }
.skeleton-line.w-md { width: 54%; }
.skeleton-line.w-lg { width: 78%; }

.skeleton-block {
    height: 64px;
    margin-top: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
}

.page-meta {
    color: var(--muted);
    font-weight: 600;
    font-family: var(--mono);
    font-size: 0.85rem;
}

[hidden] {
    display: none !important;
}
