/* ==================
   Variables
   ================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-50);
}

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

a:hover {
    text-decoration: underline;
}

/* ==================
   Layout
   ================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.main {
    min-height: calc(100vh - 140px);
    padding: 24px 0;
}

/* ==================
   Header
   ================== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    height: 64px;
    position: relative;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav a:not(.btn) {
    padding: 8px 16px;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
}

.nav a:not(.btn):hover {
    color: var(--gray-900);
    background: var(--gray-100);
    text-decoration: none;
}

.nav a.nav-active {
    color: var(--gray-900);
    border-bottom: 2px solid var(--gray-900);
    border-radius: 0;
}

.nav-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 6px 8px;
    color: var(--gray-600);
    text-decoration: none;
    margin-left: auto;
}

.nav-bell:hover {
    color: var(--gray-900);
}

.nav-bell svg {
    display: block;
}

.nav-bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.user-name {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
    padding: 0 12px;
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    flex-direction: column;
    gap: 4px;
}

/* When bell is present, it takes the margin-left: auto, hamburger just needs a small gap */
.nav-bell + .nav-hamburger {
    margin-left: 4px;
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 1px;
    transition: all 0.2s;
}

/* ==================
   Footer
   ================== */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 24px 0;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

/* ==================
   Buttons
   ================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ==================
   Cards
   ================== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.card-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-header p {
    margin: 0;
    color: var(--gray-500);
    font-size: 14px;
}

.card-body {
    padding: 24px;
}

/* ==================
   Card List
   ================== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.card-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.card-item-content h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-item-content .meta {
    font-size: 13px;
    color: var(--gray-500);
}

.card-item-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.card-item-wrapper {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-item-wrapper .card-item {
    box-shadow: none;
    border-radius: 0;
}

.card-item-wrapper .card-item:hover {
    box-shadow: none;
    transform: none;
    background: var(--gray-50);
}

/* ==================
   Forms
   ================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    margin-top: 24px;
}

.form-narrow {
    max-width: 400px;
}

/* ==================
   Alerts
   ================== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error, .error-message {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success, .success-message {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ==================
   Badges
   ================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

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

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ==================
   Page Header
   ================== */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.invite-intro {
    font-size: 15px;
    color: var(--gray-500);
    margin: 0 0 4px;
}

.page-header p, .page-header .meta {
    margin: 0;
    color: var(--gray-500);
    font-size: 15px;
}

.page-header-content {
    flex: 1;
}

.page-header-actions {
    display: flex;
    gap: 10px;
}

/* ==================
   Back Link
   ================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
}

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

/* ==================
   Empty State
   ================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--gray-700);
    font-size: 18px;
}

.empty-state p {
    margin: 0 0 20px;
}

/* ==================
   Auth Pages
   ================== */
.auth-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
    text-align: center;
}

.auth-card > p {
    margin: 0 0 24px;
    text-align: center;
    color: var(--gray-500);
}

.code-input {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 8px;
    text-align: center;
    padding: 14px 16px;
}

.verify-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
}

.verify-footer p {
    margin: 0;
}

.verify-footer a {
    color: var(--primary);
}

/* ==================
   Hero
   ================== */
.hero {
    text-align: center;
    padding: 72px 20px 32px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: 36px;
    font-weight: 800;
    color: var(--gray-900);
}

.hero p {
    margin: 0 0 24px;
    font-size: 18px;
    color: var(--gray-600);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==================
   How It Works / Features
   ================== */
.how-it-works-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 40px 0 0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    padding: 24px 0 40px;
}

.feature {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.feature h3 {
    margin: 0 0 8px;
    color: var(--gray-900);
}

.feature p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
}

/* ==================
   Dashboard
   ================== */
.dashboard-section {
    margin-bottom: 24px;
}

.dashboard-section .section-title {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray-500);
}

.dashboard-section .card-list {
    gap: 6px;
}

.dashboard-section .card-item {
    padding: 10px 16px;
}

.dashboard-section .card-item-content h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0;
}

.dashboard-section .card-item-content .meta {
    font-size: 12px;
}

.dashboard-section .card-item-meta .members {
    font-size: 13px;
    color: var(--gray-500);
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.errors-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ==================
   Prediction Table
   ================== */
.prediction-table {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.prediction-table.locked {
    pointer-events: none;
}

.prediction-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    cursor: grab;
}

.prediction-row:last-child {
    border-bottom: none;
}

.prediction-row:hover {
    background: var(--gray-50);
}

.prediction-row:active {
    cursor: grabbing;
    background: var(--gray-100);
}

.prediction-row .position {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-600);
    margin-right: 14px;
}

.prediction-row .team-name {
    flex: 1;
    font-size: 15px;
    color: var(--gray-800);
}

.prediction-row .drag-handle {
    color: var(--gray-400);
    font-size: 20px;
    padding: 4px;
}

.save-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.save-message.success {
    background: #f0fdf4;
    color: #166534;
}

.save-message.error {
    background: #fef2f2;
    color: #991b1b;
}

/* ==================
   Standings
   ================== */
.standings {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.standings-header {
    display: flex;
    padding: 12px 16px;
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
}

.standings-row {
    display: flex;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.standings-row:last-child {
    border-bottom: none;
}

.standings-row.no-prediction {
    opacity: 0.5;
}

.standings .rank {
    width: 48px;
    font-weight: 600;
    color: var(--gray-600);
}

.standings .user {
    flex: 1;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.standings .score {
    width: 80px;
    text-align: right;
    font-weight: 500;
    color: var(--gray-600);
}

/* ==================
   Groups
   ================== */
.group-page .page-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 0;
}

.group-page .card-header {
    padding: 14px 20px;
}

.group-page .card-header h2 {
    font-size: 15px;
    margin-bottom: 0;
}

.group-page .card-body {
    padding: 16px 20px;
}

.group-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 13px;
}

.group-meta-divider {
    width: 1px;
    height: 14px;
    background: var(--gray-300);
}

.invite-link-inline {
    color: var(--gray-500);
    font-size: 13px;
}

.join-code-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    border: 1px dashed var(--gray-300);
}

.join-code-box .label {
    font-size: 13px;
    color: var(--gray-500);
}

.join-code-box .code {
    font-size: 18px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 2px;
    color: var(--primary);
}

.join-section {
    background: var(--gray-50);
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.join-form .join-input-group {
    display: flex;
    gap: 12px;
    max-width: 320px;
}

.join-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.join-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.join-form .error-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
}

.join-code {
    font-size: 12px;
    font-weight: 600;
    font-family: monospace;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.prediction-groups {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.groups-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.group-tag {
    display: inline-block;
    padding: 4px 10px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: 12px;
    color: var(--gray-700);
}

.group-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

/* ==================
   Success State
   ================== */
.success-state {
    text-align: center;
}

.success-state h2 {
    margin: 0 0 8px;
    color: var(--gray-900);
}

.success-hint {
    font-size: 14px;
    color: var(--gray-500);
}

.invite-link-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 20px 0;
}

.invite-link-url {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
    word-break: break-all;
    text-align: left;
}

.invite-link-display .btn {
    flex-shrink: 0;
}

/* ==================
   Error Page
   ================== */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 72px;
    margin: 0;
    color: var(--gray-300);
}

.error-page p {
    margin: 0 0 24px;
    color: var(--gray-500);
}

/* ==================
   Utilities
   ================== */
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }

.login-prompt {
    text-align: center;
    padding: 24px;
}

.login-prompt h3 {
    margin: 0 0 8px;
}

.login-prompt p {
    margin: 0;
    color: var(--gray-500);
}

/* ==================
   Two Column Layout
   ================== */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ==================
   Standings Table
   ================== */
.standings-table {
    overflow-x: auto;
}

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

.standings-table th,
.standings-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.standings-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    background: var(--gray-50);
}

.standings-table td {
    font-size: 14px;
}

.standings-table .pos {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--gray-600);
}

.standings-table .team {
    font-weight: 500;
}

.standings-table .stat {
    width: 40px;
    text-align: center;
    color: var(--gray-600);
}

.standings-table .pts {
    font-weight: 700;
    color: var(--gray-900);
}

.standings-table .hide-mobile {
    display: table-cell;
}

/* Group Standings */
.group-standings table {
    width: 100%;
}

.group-standings th,
.group-standings td {
    padding: 10px 12px;
}

.group-standings .rank {
    width: 50px;
    font-weight: 600;
}

.group-standings .user {
    font-weight: 500;
}

.group-standings .score {
    width: 80px;
    text-align: right;
    font-weight: 600;
}

.group-standings tr.no-prediction {
    opacity: 0.5;
}

.group-standings tr.current-user {
    background: rgba(37, 99, 235, 0.05);
}

.group-standings tr.current-user td {
    border-bottom-color: rgba(37, 99, 235, 0.2);
}

/* ==================
   Score Display
   ================== */
.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.score-display .label {
    font-size: 14px;
    color: var(--gray-600);
}

.score-display .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
}

/* ==================
   Checkbox Label
   ================== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.form-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--gray-500);
}

.success-hint {
    color: var(--success);
    font-weight: 500;
}

/* ==================
   Admin
   ================== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.admin-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    background: var(--gray-50);
}

.admin-table .actions {
    white-space: nowrap;
}

.admin-table .actions form {
    margin-right: 8px;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.hint-box {
    margin-top: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 14px;
}

.hint-box h4 {
    margin: 0 0 12px;
    font-size: 14px;
}

.hint-box ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.hint-box li {
    margin-bottom: 4px;
}

.hint-box .hint {
    margin: 0;
    color: var(--gray-500);
    font-size: 13px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

/* ==================
   League Search
   ================== */
.league-search {
    position: relative;
    margin-bottom: 24px;
}

.league-search .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.league-search .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 360px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 4px;
}

.search-result-item {
    display: block;
    padding: 12px 16px;
    color: var(--gray-800);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.search-result-item .meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-left: 8px;
}

.search-result-item .badge {
    margin-left: 8px;
}

.search-empty {
    padding: 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

.section-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}


/* ==================
   League Quick Picks (Group Create)
   ================== */
.league-picker-group {
    margin-bottom: 12px;
}

.league-picker-group:last-of-type {
    margin-bottom: 16px;
}

.league-picker-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: 6px;
}

.league-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.league-pick {
    display: inline-block;
    padding: 5px 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
}

.league-pick .pick-season {
    font-size: 11px;
    color: var(--gray-400);
}

.league-pick:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f4ff;
}

.league-pick.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.league-search-wrapper {
    position: relative;
}

.selected-league {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--gray-800);
}

.selected-league .btn-clear {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: auto;
}

.selected-league .btn-clear:hover {
    color: var(--gray-700);
}

.prediction-nudge .card-body {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.prediction-nudge .card-body p {
    margin: 0;
    flex: 1;
}

.social-prompt h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.social-prompt p {
    margin: 0 0 16px;
    color: var(--gray-600);
}

.social-prompt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-list.compact .card-item {
    padding: 10px 16px;
}

.card-list.compact .card-item-content h3 {
    font-size: 14px;
    font-weight: 500;
}


/* ==================
   Notifications
   ================== */
.notification-list {
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
    transition: background 0.1s;
}

.notification-item:last-child {
    border-bottom: none;
}

a.notification-item:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.notification-item.unread {
    background: #f0f4ff;
}

.notification-item.unread:hover {
    background: #e8eeff;
}

.notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-600);
}

.notification-item.unread .notification-icon {
    background: #dbeafe;
    color: var(--primary);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: var(--gray-400);
}


/* ==================
   Per-Team Errors
   ================== */
.prediction-row .team-error {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #fef2f2;
    color: #991b1b;
    min-width: 32px;
    text-align: center;
}

.prediction-row .team-error.exact {
    background: #f0fdf4;
    color: #166534;
}

.prediction-row.exact {
    background: #f0fdf430;
}

.prediction-row.has-error {
    /* subtle tint for rows with errors */
}

.prediction-table.locked {
    pointer-events: none;
}

.prediction-table.locked .prediction-row {
    cursor: default;
    padding: 8px 16px;
}

/* ==================
   Member Predictions (Group Page)
   ================== */
.member-predictions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.member-prediction-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.member-prediction-card.current-user {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.member-prediction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.member-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-total-errors {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.prediction-table.compact .prediction-row {
    padding: 8px 12px;
}

.prediction-table.compact .prediction-row .position {
    width: 24px;
    height: 24px;
    font-size: 12px;
    margin-right: 10px;
}

.prediction-table.compact .prediction-row .team-name {
    font-size: 13px;
}

.prediction-table.compact .prediction-row .team-error {
    font-size: 11px;
    padding: 1px 6px;
}

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

    /* Nav hidden by default, shown when menu-open */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: 8px 0;
        gap: 0;
        z-index: 100;
    }

    .header.menu-open .nav {
        display: flex;
        align-items: stretch;
    }

    /* Animate hamburger to X when open */
    .header.menu-open .nav-hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    .header.menu-open .nav-hamburger span:nth-child(2) {
        opacity: 0;
    }
    .header.menu-open .nav-hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }

    .nav a:not(.btn) {
        padding: 12px 20px;
        font-size: 15px;
        border-radius: 0;
    }

    .nav a.nav-active {
        border-bottom: none;
        background: var(--gray-50);
        font-weight: 600;
    }

    .nav .btn {
        all: unset;
        padding: 12px 20px;
        font-size: 15px;
        color: var(--gray-600);
        cursor: pointer;
    }

    .user-name {
        display: block;
        padding: 8px 20px 0;
        font-size: 13px;
        color: var(--gray-400);
        border-top: 1px solid var(--gray-100);
    }

    .card-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .card-item-meta {
        width: 100%;
    }

    .group-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .group-meta-divider {
        display: none;
    }

    .invite-link-inline {
        word-break: break-all;
    }

    .group-standings th,
    .group-standings td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .group-standings .rank {
        width: 36px;
    }

    .group-standings .score {
        width: 60px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-actions {
        flex-direction: column;
    }


    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .page-header-actions {
        width: 100%;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .standings-table .hide-mobile {
        display: none;
    }

    .member-predictions {
        grid-template-columns: 1fr;
    }
}
