:root {
    --bg-dark: #090d16;
    --card-bg: rgba(23, 31, 51, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #10b981;
    --primary-hover: #059669;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --badge-pending: #f59e0b;
    --badge-open: #10b981;
    --badge-closed: #6366f1;
    --badge-cancelled: #64748b;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

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

.hidden {
    display: none !important;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.12), transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(59, 130, 246, 0.15), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08), transparent 60%);
    z-index: -1;
}

.layout-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.4));
}

.brand-text h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 13px;
    color: var(--text-muted);
}

.release-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.whats-new-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
}

.whats-new-link:hover,
.whats-new-link:focus-visible {
    color: #bfdbfe;
    text-decoration: underline;
}

.header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
}

.current-user-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.styled-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.styled-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.info-page-container {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.info-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.info-page-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-page-brand h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 21px;
}

.info-page-hero {
    margin-bottom: 18px;
    padding: 26px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(59, 130, 246, 0.14));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
}

.info-page-hero h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    margin-bottom: 8px;
}

.info-page-hero p,
.info-page-copy {
    color: var(--text-muted);
    line-height: 1.6;
}

.info-page-card {
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.support-identity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.identity-field,
.release-detail {
    padding: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
}

.identity-field span,
.release-detail span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 3px;
}

.info-status {
    display: none;
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius-md);
    line-height: 1.5;
}

.info-status.visible {
    display: block;
}

.info-status.success {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.13);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.info-status.error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.profile-security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.1);
}

.profile-security-note > span {
    font-size: 24px;
}

.profile-security-note p,
.profile-update-hint {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.profile-update-hint {
    margin-bottom: 18px;
    padding: 12px;
    border-left: 3px solid var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.optional-label {
    margin-left: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
}

.profile-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.release-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
}

.release-feature-list {
    display: grid;
    gap: 10px;
    list-style: none;
    counter-reset: release-feature;
}

.release-feature-list li {
    counter-increment: release-feature;
    padding: 13px 14px 13px 48px;
    position: relative;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    line-height: 1.45;
}

.release-feature-list li::before {
    content: counter(release-feature);
    position: absolute;
    left: 14px;
    top: 12px;
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.3);
    font-size: 11px;
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #042f2e;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

/* Stats Row */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.05);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

/* Layout Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.subtitle-link {
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
    padding-bottom: 1px;
}

.subtitle-link:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
    text-shadow: 0 0 8px rgba(147, 197, 253, 0.4);
}

.leaderboard-view-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.leaderboard-view-toggle {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.28);
}

.leaderboard-view-btn {
    min-height: 36px;
    padding: 7px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.leaderboard-view-btn:hover,
.leaderboard-view-btn:focus-visible {
    color: var(--text-main);
    outline: 2px solid rgba(16, 185, 129, 0.55);
    outline-offset: -2px;
}

.leaderboard-view-btn.active {
    color: #052e24;
    background: var(--primary);
}

.leaderboard-week-range {
    color: var(--text-muted);
    font-size: 12px;
}

/* Leaderboard Table */
.table-responsive {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.leaderboard-table th {
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--card-border);
}

.leaderboard-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rank-badge {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
}

.rank-1 { background: #f59e0b; color: #451a03; }
.rank-2 { background: #94a3b8; color: #0f172a; }
.rank-3 { background: #b45309; color: #fef3c7; }
.rank-other { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    color: var(--text-main);
}

.player-contact {
    font-size: 12px;
    color: var(--text-muted);
}

.score-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #a7f3d0;
    font-size: 16px;
}

.score-delta-positive { color: #6ee7b7; }
.score-delta-negative { color: #fca5a5; }
.score-delta-neutral { color: var(--text-muted); }

.mobile-score-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.mobile-score-block small {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tenure-chip {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.active-limit-chip {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
}

.limit-reached {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

/* Matches List */
.tab-filters {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 600;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 4px;
}

.challenge-panel-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.challenge-group {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    background: rgba(2, 6, 23, 0.25);
}

.challenge-group-public {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
}

.challenge-group-private {
    border-color: rgba(148, 163, 184, 0.24);
}

.challenge-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.challenge-group-header h3 {
    font-size: 15px;
}

.challenge-group-header p {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.challenge-count {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 700;
}

.challenge-type-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.challenge-type-PUBLIC {
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.15);
}

.challenge-type-PRIVATE {
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.1);
}

.challenge-kind-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
}

.challenge-kind-public {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
}

.challenge-kind-private {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.08);
}

.challenge-kind-icon {
    font-size: 24px;
}

.challenge-kind-summary > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.challenge-kind-summary small {
    color: var(--text-muted);
    font-size: 11px;
}

.match-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
}

.match-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.match-card.match-card-deep-linked {
    border-color: rgba(52, 211, 153, 0.9);
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25), 0 0 24px rgba(16, 185, 129, 0.35);
}

.match-chat-read-only {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-md);
    background: rgba(14, 116, 144, 0.12);
    color: #bae6fd;
    font-size: 13px;
    text-align: center;
}

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

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-PENDING { background: rgba(245, 158, 11, 0.2); color: var(--badge-pending); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-OPEN { background: rgba(16, 185, 129, 0.2); color: var(--badge-open); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-CLOSED { background: rgba(99, 102, 241, 0.2); color: var(--badge-closed); border: 1px solid rgba(99, 102, 241, 0.3); }
.status-CANCELLED { background: rgba(100, 116, 139, 0.2); color: var(--badge-cancelled); border: 1px solid rgba(100, 116, 139, 0.3); }

.match-players {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 12px;
    margin: 4px 0;
}

.player-box {
    text-align: center;
    flex: 1;
}

.match-player-name {
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.winner-player-box {
    padding: 8px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.05);
}

.winner-stamp {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 9px;
    border: 2px solid rgba(248, 62, 62, 0.9);
    border-radius: 4px;
    background: rgba(127, 29, 29, 0.18);
    color: #ff5c5c;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    line-height: 1;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
    transform: rotate(-7deg);
}

.vs-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
}

.match-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.match-closed-at {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}

.challenge-link-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    font-size: 14px;
}

.challenge-link-notice-success {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0;
}

.qr-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.qr-code-image {
    width: min(280px, 100%);
    height: auto;
    aspect-ratio: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    background: #fff;
}

.qr-target-url {
    display: block;
    width: 100%;
    padding: 10px;
    overflow-wrap: anywhere;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.8);
    color: #bfdbfe;
    font-size: 12px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;

    transition: opacity 0.2s ease-in-out;
}

.modal-backdrop.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background: #111827;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.wide-modal {
    max-width: 720px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: #f8fafc;
    font-size: 14px;
    outline: none;
}

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

.login-glow-input {
    border-color: rgba(16, 185, 129, 0.85);
    box-shadow:
        0 0 0 1px rgba(16, 185, 129, 0.25),
        0 0 14px rgba(16, 185, 129, 0.38),
        inset 0 0 8px rgba(16, 185, 129, 0.08);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-glow-input:hover {
    border-color: rgba(52, 211, 153, 0.95);
    box-shadow:
        0 0 0 1px rgba(52, 211, 153, 0.3),
        0 0 18px rgba(16, 185, 129, 0.48),
        inset 0 0 8px rgba(16, 185, 129, 0.1);
}

.login-glow-input:focus {
    border-color: #34d399;
    box-shadow:
        0 0 0 2px rgba(52, 211, 153, 0.35),
        0 0 22px rgba(16, 185, 129, 0.65),
        inset 0 0 10px rgba(16, 185, 129, 0.12);
}

.chat-schedule-btn {
    padding: 4px 8px;
    margin-left: 6px;
    font-size: 12px;
    gap: 6px;
}

.chat-schedule-btn.has-unread-notes {
    border-color: #34d399;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.18);
    box-shadow:
        0 0 0 1px rgba(52, 211, 153, 0.3),
        0 0 16px rgba(16, 185, 129, 0.5);
}

.unread-note-indicator {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    color: #052e24;
    background: #6ee7b7;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.match-chat-whatsapp-option {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: var(--radius-md);
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.1);
    font-size: 13px;
    cursor: pointer;
}

.match-chat-whatsapp-option input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.match-chat-delivery-status {
    min-height: 18px;
    margin-top: 6px;
    color: #6ee7b7;
    font-size: 12px;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    flex-shrink: 0;
}

/* Winner selection grid */
.winner-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.winner-option-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}

.winner-option-btn.selected {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.15);
}

.winner-name {
    font-weight: 600;
}

.winner-score {
    font-size: 12px;
    color: var(--text-muted);
}

.point-exchange-preview {
    background: rgba(16, 185, 129, 0.1);
    border: 1px dashed var(--primary);
    padding: 10px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 14px;
    color: #a7f3d0;
    margin-top: 12px;
}

.notifications-log-container {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.whatsapp-log-item {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 13px;
}

.log-recipient {
    color: var(--primary);
    font-weight: 600;
}

.log-time {
    color: var(--text-muted);
    font-size: 11px;
    float: right;
}

.log-msg {
    margin-top: 6px;
    white-space: pre-wrap;
    color: #e2e8f0;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 14px;
}

/* Device Auto-Detection Indicator Badge */
.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid var(--accent);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: 8px;
}

/* Mobile Bottom Navigation Bar (Hidden on Desktop) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--card-border);
    z-index: 999;
    padding: 8px 12px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px;
    min-width: 60px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.mobile-nav-item .nav-icon {
    font-size: 20px;
}

.mobile-nav-item.active, .mobile-nav-item:active {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

/* Viewport & Device Visibility Utilities */
.mobile-only-view {
    display: none !important;
}
.desktop-only-view {
    display: block;
}

body.desktop-view .mobile-only-view {
    display: none !important;
}
body.desktop-view .desktop-only-view {
    display: block;
}

body.mobile-view .desktop-only-view {
    display: none !important;
}
body.mobile-view .mobile-only-view {
    display: flex !important;
}

/* GPU hardware acceleration for smoother mobile rendering */
.app-background, .top-header, .card, .stat-card, .mobile-bottom-nav, .modal-card {
    transform: translateZ(0);
}

/* Mobile Leaderboard Cards */
.mobile-leaderboard-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-player-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.mobile-player-card:active {
    transform: scale(0.99);
    border-color: var(--primary);
}

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

.mobile-player-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-card-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.mobile-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mobile-card-action {
    margin-top: 2px;
}

.mobile-card-action .btn {
    width: 100%;
    justify-content: center;
}

/* Dedicated Mobile Phone Screen UI Layout (width < 768px or .mobile-view) */
@media (max-width: 767px) {
    .mobile-only-view {
        display: flex !important;
    }
    .desktop-only-view {
        display: none !important;
    }

    body {
        padding-bottom: 75px; /* Spacing for bottom nav */
    }

    .layout-container {
        padding: 12px;
    }

    /* Compact Mobile Top Header */
    .top-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        margin-bottom: 16px;
    }

    .brand {
        justify-content: center;
    }

    .brand-text h1 {
        font-size: 20px;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .header-actions .btn {
        flex: 1 1 calc(50% - 8px);
        min-height: 44px; /* Touch friendly tap target */
        justify-content: center;
        font-size: 13px;
    }

    /* Show Mobile Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Single-Column Mobile Card Layout */
    .main-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .leaderboard-section .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .leaderboard-view-controls {
        align-items: stretch;
    }

    .leaderboard-view-toggle {
        width: 100%;
    }

    .leaderboard-view-btn {
        flex: 1;
        min-height: 44px;
    }

    .leaderboard-week-range {
        text-align: center;
    }

    .challenge-group {
        padding: 12px;
    }

    .info-page-container {
        width: min(100% - 20px, 760px);
        padding-top: 14px;
    }

    .info-page-header {
        align-items: flex-start;
    }

    .info-page-hero,
    .info-page-card {
        padding: 18px;
    }

    .info-page-hero h2 {
        font-size: 24px;
    }

    .support-identity,
    .release-details-grid {
        grid-template-columns: 1fr;
    }

    /* 2x2 Grid for Stats Overview on Mobile */
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .stat-value {
        font-size: 18px;
    }

    /* Mobile Touch Modal Bottom Sheet */
    .modal-card {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 75px);
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 60px;
        left: 0;
        margin: 0;
        padding: 20px 20px calc(16px + env(safe-area-inset-bottom, 0px)) 20px;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .modal-actions .btn {
        width: 100%;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .winner-selection-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        min-height: 44px; /* Touch target size */
    }
}
