/* ============================================
   POWERPLAY - Fantasy Cricket Analytics
   Dream11-inspired Dark Theme
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-elevated: #1e2a45;
    --accent-primary: #e94560;
    --accent-hover: #ff6b81;
    --accent-orange: #ff8c00;
    --accent-orange-glow: rgba(255, 140, 0, 0.15);
    --accent-purple: #9b59b6;
    --accent-purple-glow: rgba(155, 89, 182, 0.15);
    --accent-gold: #ffd700;
    --accent-silver: #c0c0c0;
    --accent-bronze: #cd7f32;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;
    --text-primary: #e0e0e0;
    --text-secondary: #8a8aa0;
    --text-heading: #ffffff;
    --text-muted: #5a5a70;
    --border-color: #2a2a4a;
    --border-light: #353560;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* === Navigation === */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-heading);
    font-weight: 800;
    font-size: 1.4rem;
}

.logo-icon {
    font-size: 1.6rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-heading);
    background: rgba(233, 69, 96, 0.1);
}

.nav-btn {
    background: var(--accent-primary) !important;
    color: var(--text-heading) !important;
    font-weight: 600 !important;
}

.nav-btn:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* === Hero === */
.hero {
    text-align: center;
    padding: 2.5rem 0 2rem;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff, var(--accent-primary), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.hero-pill {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hero-pill strong {
    color: var(--text-heading);
    margin-right: 0.2rem;
}

/* === Dashboard Two-Column Grid === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.caps-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.caps-column .cap-card {
    flex-direction: row;
    text-align: left;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.caps-column .cap-hat {
    width: 50px;
    height: 40px;
}

.caps-column .cap-hat-crown {
    width: 38px;
    height: 24px;
    left: 6px;
    bottom: 8px;
}

.caps-column .cap-hat-brim {
    width: 50px;
    height: 10px;
    left: -2px;
    bottom: 3px;
}

.caps-column .cap-badge {
    font-size: 0.55rem;
    padding: 0.2rem 0.5rem;
    letter-spacing: 2px;
}

.caps-column .cap-subtitle {
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
}

.caps-column .cap-username {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.caps-column .cap-points-value {
    font-size: 1.3rem;
}

.caps-column .cap-points-label {
    font-size: 0.55rem;
}

.caps-column .cap-meta {
    font-size: 0.7rem;
}

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.8rem;
    color: var(--text-heading);
}

h1 {
    font-size: 1.8rem;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
}

/* === Caps Section (IPL Style) === */
.caps-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cap-card {
    position: relative;
    border-radius: 20px;
    padding: 2rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: default;
}

.cap-card:hover {
    transform: translateY(-6px) scale(1.01);
}

/* Glow effect behind card */
.cap-glow {
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
}

/* Orange Cap Card */
.orange-cap {
    background: linear-gradient(145deg, #2d1800 0%, #1a0f00 40%, #0f0f1a 100%);
    border: 1px solid rgba(255, 140, 0, 0.25);
    box-shadow: 0 8px 32px rgba(255, 140, 0, 0.08), inset 0 1px 0 rgba(255, 140, 0, 0.1);
}

.orange-cap:hover {
    box-shadow: 0 16px 48px rgba(255, 140, 0, 0.2), inset 0 1px 0 rgba(255, 140, 0, 0.15);
}

.orange-cap .cap-glow {
    background: radial-gradient(circle, #ff8c00, transparent 70%);
}

/* Purple Cap Card */
.purple-cap {
    background: linear-gradient(145deg, #1a0a2e 0%, #120728 40%, #0f0f1a 100%);
    border: 1px solid rgba(155, 89, 182, 0.25);
    box-shadow: 0 8px 32px rgba(155, 89, 182, 0.08), inset 0 1px 0 rgba(155, 89, 182, 0.1);
}

.purple-cap:hover {
    box-shadow: 0 16px 48px rgba(155, 89, 182, 0.2), inset 0 1px 0 rgba(155, 89, 182, 0.15);
}

.purple-cap .cap-glow {
    background: radial-gradient(circle, #9b59b6, transparent 70%);
}

/* CSS Cap Hat Visual */
.cap-visual {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.cap-hat {
    position: relative;
    width: 90px;
    height: 70px;
}

.cap-hat-crown {
    position: absolute;
    bottom: 14px;
    left: 10px;
    width: 70px;
    height: 42px;
    border-radius: 50% 50% 0 0;
}

.cap-hat-brim {
    position: absolute;
    bottom: 6px;
    left: -4px;
    width: 90px;
    height: 18px;
    border-radius: 50%;
}

.orange-hat .cap-hat-crown {
    background: linear-gradient(160deg, #ffb347 0%, #ff8c00 50%, #e07600 100%);
    box-shadow: 0 -4px 20px rgba(255, 140, 0, 0.3), inset 0 4px 8px rgba(255, 255, 255, 0.15);
}

.orange-hat .cap-hat-brim {
    background: linear-gradient(180deg, #e07600 0%, #cc6a00 100%);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.25);
}

.purple-hat .cap-hat-crown {
    background: linear-gradient(160deg, #c39bd3 0%, #9b59b6 50%, #7d3c98 100%);
    box-shadow: 0 -4px 20px rgba(155, 89, 182, 0.3), inset 0 4px 8px rgba(255, 255, 255, 0.15);
}

.purple-hat .cap-hat-brim {
    background: linear-gradient(180deg, #7d3c98 0%, #6c3483 100%);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.25);
}

/* Cap shine/reflection */
.cap-hat-crown::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 12px;
    width: 30px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    filter: blur(4px);
}

/* Cap Content */
.cap-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.cap-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 3px;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 140, 0, 0.05));
    color: #ffb347;
    border: 1px solid rgba(255, 140, 0, 0.2);
}

.cap-badge.purple-badge {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(155, 89, 182, 0.05));
    color: #c39bd3;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.cap-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.cap-username {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.cap-points-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.cap-points-value {
    font-size: 2rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.orange-cap .cap-points-value {
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.purple-cap .cap-points-value {
    background: linear-gradient(135deg, #c39bd3, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cap-points-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.cap-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* === Leaderboard Card === */
.leaderboard-card {
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leaderboard-header h2 {
    font-size: 1.15rem;
}

.leaderboard-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Rank medal emojis */
.rank-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

/* Player row in table */
.player-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.player-avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-orange));
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.player-name {
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.95rem;
}

.player-row:hover .player-name {
    color: var(--accent-primary);
}

.muted-cell {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.gap-value {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.stat-card.accent {
    border-color: rgba(233, 69, 96, 0.3);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(233, 69, 96, 0.05));
}

.stat-card.best {
    border-color: rgba(46, 204, 113, 0.3);
}

.stat-card.worst {
    border-color: rgba(231, 76, 60, 0.3);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

/* === Cards === */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.card-body {
    padding: 1.5rem;
}

/* Highlight Card */
.highlight-card {
    border-color: rgba(233, 69, 96, 0.3);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(233, 69, 96, 0.05));
}

.leader-highlight {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(255, 215, 0, 0.05));
}

.highlight-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.highlight-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.leader-highlight .highlight-number {
    color: var(--accent-gold);
}

.highlight-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* === Tables === */
.table-responsive {
    overflow-x: auto;
    padding: 0;
}

.table-responsive .rank-table {
    margin: 0;
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
}

.rank-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.rank-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

.rank-table tbody tr:last-child {
    border-bottom: none;
}

.rank-table tbody tr:hover {
    background: rgba(22, 33, 62, 0.5);
}

.rank-table tbody tr.rank-top {
    background: rgba(22, 33, 62, 0.3);
}

.rank-table td {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
}

.rank-table.compact td {
    padding: 0.625rem 1rem;
}

.points-cell {
    font-weight: 700;
    color: var(--text-heading);
    font-variant-numeric: tabular-nums;
}

.gap-cell {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.gap-cell.negative {
    color: var(--accent-primary);
    font-weight: 600;
}

.leader-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

.player-link {
    color: var(--text-heading);
    font-weight: 600;
}

.player-link:hover {
    color: var(--accent-primary);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
}

.badge-gold {
    font-size: 1.3rem;
}

.badge-silver {
    font-size: 1.3rem;
}

.badge-bronze {
    font-size: 1.3rem;
}

.badge-rank {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* === Player Header (User Detail) === */
.player-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.player-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.player-info h1 {
    margin-bottom: 0.25rem;
    font-size: 1.6rem;
}

.player-rank-badge .badge {
    font-size: 0.9rem;
    height: auto;
    min-width: auto;
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.75rem;
}

/* === User Grid === */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
}

.user-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
}

.user-name {
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.user-action {
    font-size: 0.8rem;
    color: var(--accent-primary);
}

/* === Match Card === */
.match-card {
    animation: fadeIn 0.5s ease;
}

.match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.match-number {
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.match-header h3 {
    font-size: 1.1rem;
    color: var(--text-heading);
    margin-top: 0.25rem;
}

/* === Forms === */
.form-inline .form-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

/* Scores Section */
.scores-section {
    margin: 1.5rem 0;
}

.scores-section h3 {
    font-size: 1rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
}

.score-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.score-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.score-label {
    font-weight: 600;
    color: var(--text-heading);
    min-width: 80px;
    font-size: 0.95rem;
    margin-bottom: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.score-input {
    flex: 1;
    max-width: 120px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius);
    width: 100%;
    margin-top: 1rem;
}

/* === Delete Button === */
.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.btn-delete:hover {
    color: var(--accent-red);
    background: rgba(231, 76, 60, 0.15);
}

.delete-form {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.user-card {
    position: relative;
}

.user-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 100%;
}

/* === Chart === */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

.chart-container canvas {
    max-height: 100%;
}

/* === Alerts === */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--accent-red);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h2 {
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* === Back Link === */
.back-link {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.back-link a {
    color: var(--text-secondary);
    font-weight: 500;
}

.back-link a:hover {
    color: var(--accent-primary);
}

/* === Footer === */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.4s ease;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        gap: 0.25rem;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        flex-wrap: wrap;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .caps-column {
        order: -1;
    }

    .caps-column .cap-card {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
        padding: 1.25rem;
    }

    .caps-column .cap-points-row {
        justify-content: flex-start;
    }

    .caps-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cap-card {
        padding: 1.5rem 1.25rem;
        gap: 1rem;
    }

    .cap-hat {
        width: 70px;
        height: 55px;
    }

    .cap-hat-crown {
        width: 55px;
        height: 34px;
        left: 8px;
        bottom: 10px;
    }

    .cap-hat-brim {
        width: 70px;
        height: 14px;
        left: -2px;
        bottom: 4px;
    }

    .cap-username {
        font-size: 1.3rem;
    }

    .cap-points-value {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .player-header {
        flex-direction: column;
        text-align: center;
    }

    .player-info h1 {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-inline .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .score-entries {
        grid-template-columns: 1fr;
    }

    .highlight-content {
        flex-direction: column;
        text-align: center;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .rank-table td, .rank-table th {
        padding: 0.625rem 0.5rem;
        font-size: 0.85rem;
    }

    .accordion-header {
        padding: 0.875rem 1rem;
    }

    .accordion-title {
        gap: 0.6rem;
    }

    .accordion-title h3 {
        font-size: 0.9rem;
    }

    .accordion-players-count {
        display: none;
    }

    .chart-container {
        height: 220px;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .user-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .user-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .user-card {
        padding: 1rem 0.75rem;
    }

    .cap-username {
        font-size: 1.1rem;
    }

    .cap-card {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .cap-points-row {
        justify-content: center;
    }

    .badge {
        min-width: 24px;
        height: 24px;
    }
}

/* === Accordion (Collapsible Match Cards) === */
.accordion-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.4s ease;
}

.accordion-item:hover {
    border-color: var(--border-light);
}

.accordion-item.open {
    border-color: rgba(233, 69, 96, 0.3);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.accordion-header:hover {
    background: rgba(22, 33, 62, 0.4);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.accordion-title .match-number {
    font-size: 0.7rem;
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    white-space: nowrap;
}

.accordion-title h3 {
    font-size: 1rem;
    color: var(--text-heading);
    margin: 0;
}

.accordion-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.accordion-players-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.accordion-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    display: inline-block;
}

.accordion-item.open .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.accordion-item.open .accordion-body {
    max-height: 1000px;
    border-top: 1px solid var(--border-color);
}

.accordion-body .rank-table {
    margin: 0;
}

.accordion-body .rank-table td,
.accordion-body .rank-table th {
    padding: 0.625rem 1rem;
}

/* Match form specific */
.match-form {
    max-width: 100%;
}
