/* Cave Shuttle Rankings — styled after in-app highscore page */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* Override the Roboyard/Bootstrap layout for Cave Shuttle pages */
body.caveshuttle-theme {
    background: #000 !important;
    color: #6ee66e;
    font-family: 'VT323', 'Courier New', monospace;
}

/* General content area — black bg, green text */
body.caveshuttle-theme #app {
    background: #000;
    color: #6ee66e;
}

body.caveshuttle-theme .container,
body.caveshuttle-theme .row,
body.caveshuttle-theme .col-md-9 {
    color: #6ee66e;
}

body.caveshuttle-theme a {
    color: #6ee66e;
}

body.caveshuttle-theme a:hover {
    color: #a0ffa0;
}

body.caveshuttle-theme h1,
body.caveshuttle-theme h2,
body.caveshuttle-theme h3,
body.caveshuttle-theme h4,
body.caveshuttle-theme h5,
body.caveshuttle-theme h6 {
    color: #6ee66e;
    text-shadow: 0 0 8px rgba(110, 230, 110, 0.5);
}

body.caveshuttle-theme .text-muted {
    color: #4a8a4a !important;
}

body.caveshuttle-theme .alert {
    background: #0a0a0a;
    border-color: #6ee66e;
    color: #6ee66e;
}

body.caveshuttle-theme .table {
    color: #6ee66e;
    border-color: rgba(110, 230, 110, 0.3);
    --bs-table-color: #6ee66e;
    --bs-table-bg: transparent;
    --bs-table-striped-color: #6ee66e;
    --bs-table-striped-bg: rgba(110, 230, 110, 0.05);
    --bs-table-active-color: #6ee66e;
    --bs-table-active-bg: rgba(110, 230, 110, 0.1);
    --bs-table-hover-color: #a0ffa0;
    --bs-table-hover-bg: #1a3d1a;
}

body.caveshuttle-theme .table thead th {
    border-bottom: 2px solid #6ee66e;
    color: #6ee66e;
}

body.caveshuttle-theme .table td,
body.caveshuttle-theme .table th {
    border-color: rgba(110, 230, 110, 0.15);
    background: #000 !important;
    color: #6ee66e;
}

body.caveshuttle-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    color: #6ee66e;
    background-color: rgba(110, 230, 110, 0.05) !important;
}

body.caveshuttle-theme .table tbody tr:hover {
    background: #1a3d1a !important;
}

body.caveshuttle-theme .table tbody tr:hover > * {
    color: #a0ffa0;
}

body.caveshuttle-theme .btn-outline-primary {
    color: #6ee66e;
    border-color: #6ee66e;
}

body.caveshuttle-theme .btn-outline-primary:hover {
    background: #1a3d1a;
    color: #a0ffa0;
}

body.caveshuttle-theme .form-control {
    background: #000;
    color: #6ee66e;
    border-color: rgba(110, 230, 110, 0.5);
}

body.caveshuttle-theme .form-select {
    background: #000;
    color: #6ee66e;
    border-color: rgba(110, 230, 110, 0.5);
}

body.caveshuttle-theme .form-select:focus {
    background: #000;
    color: #6ee66e;
    border-color: #6ee66e;
    box-shadow: 0 0 4px rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .form-label {
    color: #6ee66e;
}

body.caveshuttle-theme .pagination .page-link {
    background: #000;
    color: #6ee66e;
    border-color: rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .pagination .page-item.active .page-link {
    background: #1a3d1a;
    border-color: #6ee66e;
    color: #a0ffa0;
}

body.caveshuttle-theme .pagination .page-item.disabled .page-link {
    color: #4a8a4a;
    border-color: rgba(110, 230, 110, 0.15);
}

body.caveshuttle-theme .btn-primary {
    background: #1a3d1a;
    border: 1px solid #6ee66e;
    color: #6ee66e;
}

body.caveshuttle-theme .btn-primary:hover {
    background: #2a5d2a;
    color: #a0ffa0;
}

body.caveshuttle-theme .btn-danger {
    background: #4d0000;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}

body.caveshuttle-theme .btn-danger:hover {
    background: #6d0000;
    color: #ff9999;
}

body.caveshuttle-theme .btn-warning {
    background: #4d3a00;
    border: 1px solid #ffd700;
    color: #ffd700;
}

body.caveshuttle-theme .btn-warning:hover {
    background: #6d5a00;
    color: #ffe44d;
}

body.caveshuttle-theme .form-control:focus {
    background: #000;
    color: #6ee66e;
    border-color: #6ee66e;
    box-shadow: 0 0 4px rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .badge {
    background: #1a3d1a;
    color: #6ee66e;
    border: 1px solid rgba(110, 230, 110, 0.3);
}

/* Footer — inverted to black bg with green text */
body.caveshuttle-theme footer {
    background: #000 !important;
    border-top: 2px solid #6ee66e;
    color: #6ee66e;
}

body.caveshuttle-theme footer a {
    color: #6ee66e;
}

body.caveshuttle-theme footer a:hover {
    color: #a0ffa0;
}

/* Navbar — inverted to black bg with green text on Cave Shuttle pages */
body.caveshuttle-theme .navbar {
    background: #000 !important;
    border-bottom: 2px solid #6ee66e;
}

body.caveshuttle-theme .navbar .navbar-brand {
    color: #6ee66e;
    font-family: 'VT323', 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(110, 230, 110, 0.5);
    letter-spacing: 1px;
}

body.caveshuttle-theme .navbar .nav-link {
    color: #6ee66e !important;
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 18px;
}

body.caveshuttle-theme .navbar .nav-link:hover,
body.caveshuttle-theme .navbar .dropdown-item:hover {
    color: #a0ffa0 !important;
    text-shadow: 0 0 6px rgba(110, 230, 110, 0.5);
}

body.caveshuttle-theme .navbar-toggler {
    border-color: #6ee66e;
}

body.caveshuttle-theme .navbar-toggler-icon {
    filter: invert(1) hue-rotate(90deg) brightness(1.5);
}

body.caveshuttle-theme .dropdown-menu {
    background: #000;
    border: 1px solid #6ee66e;
}

body.caveshuttle-theme .dropdown-item {
    color: #6ee66e;
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 16px;
}

body.caveshuttle-theme .dropdown-item:hover {
    background: #1a3d1a;
}

body.caveshuttle-theme .dropdown-divider {
    border-color: rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .btn-success {
    background: #1a3d1a !important;
    border: 1px solid #6ee66e !important;
    color: #6ee66e !important;
    font-family: 'VT323', 'Courier New', monospace;
}

/* Sidebar card — black bg, green text on Cave Shuttle pages */
body.caveshuttle-theme .card {
    background: #000;
    border: 1px solid #6ee66e;
}

body.caveshuttle-theme .card-header {
    background: #000;
    border-bottom: 1px solid rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .card-header h5 {
    color: #6ee66e;
    font-family: 'VT323', 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(110, 230, 110, 0.5);
    letter-spacing: 1px;
}

body.caveshuttle-theme .list-group-item {
    background: #000;
    color: #6ee66e;
    border-color: rgba(110, 230, 110, 0.15);
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 17px;
}

body.caveshuttle-theme .list-group-item:hover {
    background: #1a3d1a;
    color: #a0ffa0;
}

body.caveshuttle-theme .list-group-item i {
    color: #6ee66e;
}

/* Modal — dark theme */
body.caveshuttle-theme .modal-content {
    background: #000;
    border: 1px solid #6ee66e;
    color: #6ee66e;
}

body.caveshuttle-theme .modal-header {
    border-bottom: 1px solid rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .modal-footer {
    border-top: 1px solid rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .modal .btn-close {
    filter: invert(1) hue-rotate(90deg) brightness(1.5);
}

body.caveshuttle-theme .modal .btn-secondary {
    background: #1a3d1a;
    border: 1px solid rgba(110, 230, 110, 0.5);
    color: #6ee66e;
}

body.caveshuttle-theme .modal .btn-info {
    background: #0a2a4d;
    border: 1px solid #00ccff;
    color: #00ccff;
}

body.caveshuttle-theme .modal .btn-outline-info {
    color: #00ccff;
    border-color: #00ccff;
}

body.caveshuttle-theme .modal .btn-outline-info:hover {
    background: #0a2a4d;
    color: #00ccff;
}

/* Offcanvas mobile menu — same style */
body.caveshuttle-theme .offcanvas {
    background: #000;
}

body.caveshuttle-theme .offcanvas-header {
    border-bottom: 1px solid rgba(110, 230, 110, 0.3);
}

body.caveshuttle-theme .offcanvas-title {
    color: #6ee66e;
    font-family: 'VT323', 'Courier New', monospace;
}

body.caveshuttle-theme .btn-close {
    filter: invert(1) hue-rotate(90deg) brightness(1.5);
}

/* Highscore title banner — from in-game highscore page */
.cs-highscore-title {
    text-align: center;
    margin: 0 0 16px 0;
}

.cs-highscore-title img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.cs-highscore-spaceship {
    display: block;
    margin: 0 auto 16px auto;
    max-width: 100%;
    height: 55px;
}

.cs-rankings {
    background: #000;
    color: #6ee66e;
    font-family: 'VT323', 'Courier New', monospace;
    min-height: 80vh;
    padding: 20px;
}

.cs-rankings * {
    box-sizing: border-box;
}

/* Override Bootstrap card/container styles within cs-rankings */
.cs-rankings .container {
    max-width: 100% !important;
    padding: 0 !important;
}

.cs-rankings h1,
.cs-rankings h2 {
    color: #6ee66e;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(110, 230, 110, 0.5);
    background: transparent;
    border: none;
}

.cs-rankings h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.cs-rankings h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
}

/* Filter bar */
.cs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #0a0a0a;
    border: 2px solid #6ee66e;
    border-radius: 8px;
}

.cs-filter-form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cs-filter-bar label {
    font-size: 16px;
    color: #aaa;
    margin-right: 4px;
    margin-bottom: 0;
}

.cs-filter-bar select {
    background: #000;
    color: #6ee66e;
    border: 1px solid rgba(110, 230, 110, 0.5);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 16px;
    cursor: pointer;
    outline: none;
}

.cs-filter-bar select:focus {
    border-color: #6ee66e;
    box-shadow: 0 0 4px rgba(110, 230, 110, 0.3);
}

.cs-filter-bar select:hover {
    border-color: #6ee66e;
}

.cs-back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: #6ee66e;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid rgba(110, 230, 110, 0.5);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
}

.cs-back-link:hover {
    background: #1a3d1a;
    border-color: #6ee66e;
    color: #6ee66e;
}

/* Table */
.cs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    background: #000;
}

.cs-table th,
.cs-table td {
    padding: 10px 14px;
    text-align: center;
    border: none;
    font-size: 18px;
}

.cs-table th {
    background: #000;
    color: #6ee66e;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-top: 2px solid #6ee66e;
}

.cs-table th:first-child {
    border-left: 2px solid #6ee66e;
}

.cs-table th:last-child {
    border-right: 2px solid #6ee66e;
}

.cs-table tbody tr {
    cursor: default;
    transition: filter 0.15s;
}

.cs-table tbody tr:hover {
    filter: brightness(1.2);
}

/* Rank-colored rows */
.cs-table tbody tr:nth-child(1) { background: #4d3a00; color: #ffd700; }
.cs-table tbody tr:nth-child(2) { background: #2a2a2a; color: #e0e0e0; }
.cs-table tbody tr:nth-child(3) { background: #4d1e00; color: #ff8800; }
.cs-table tbody tr:nth-child(4) { background: #001a4d; color: #00ffff; }
.cs-table tbody tr:nth-child(5) { background: #2e004d; color: #ff00ff; }
.cs-table tbody tr:nth-child(6) { background: #004d4d; color: #00ffff; }
.cs-table tbody tr:nth-child(7) { background: #4d0000; color: #ff0000; }
.cs-table tbody tr:nth-child(8) { background: #004d00; color: #6ee66e; }
.cs-table tbody tr:nth-child(9) { background: #2e004d; color: #cc00ff; }
.cs-table tbody tr:nth-child(10) { background: #001a4d; color: #00ccff; }

.cs-table:not(.cs-levels-table) tbody tr:nth-child(-n+3) td.cs-rank::after {
    content: ' 🏆';
}

/* Bottom border */
.cs-table tbody tr:last-child td {
    border-bottom: 2px solid #6ee66e;
}

.cs-table tbody tr:last-child td:first-child {
    border-left: 2px solid #6ee66e;
}

.cs-table tbody tr:last-child td:last-child {
    border-right: 2px solid #6ee66e;
}

/* Left/right borders on all body rows */
.cs-table tbody td:first-child {
    border-left: 2px solid #6ee66e;
}

.cs-table tbody td:last-child {
    border-right: 2px solid #6ee66e;
}

.cs-table .cs-rank {
    width: 80px;
    font-weight: 700;
    white-space: nowrap;
}

.cs-table .cs-score {
    font-weight: 700;
    font-size: 1.2rem;
}

.cs-warning-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    padding: 0;
    margin-left: 4px;
    border: 1px solid #ff6b6b;
    border-radius: 50%;
    background: #2a0808;
    color: #ff6b6b;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.cs-warning-flag:hover,
.cs-warning-flag:focus-visible {
    background: #ff6b6b;
    color: #000;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
    outline: none;
}

.cs-warning-modal .modal-content {
    border: 2px solid #ff6b6b;
    background: #080808;
    color: #ddd;
    box-shadow: 0 0 24px rgba(255, 107, 107, 0.35);
}

.cs-warning-modal .modal-header,
.cs-warning-modal .modal-footer {
    border-color: rgba(255, 107, 107, 0.45);
}

.cs-warning-modal .modal-title {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.cs-warning-modal .modal-body {
    text-align: left;
}

.cs-warning-modal .modal-body ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
    color: #ffb3b3;
}

.cs-warning-modal .btn-close {
    filter: invert(1);
}

.cs-table .cs-name {
    text-transform: uppercase;
}

.cs-table .cs-name a {
    color: inherit;
    text-decoration: none;
}

.cs-table .cs-name a:hover {
    text-decoration: underline;
}

/* Empty state */
.cs-empty {
    text-align: center;
    color: #888;
    padding: 40px;
    font-size: 1.2rem;
}

/* Pagination — override Laravel Bootstrap pagination */
.cs-pagination {
    margin-top: 20px;
    display: flex;
    gap: 4px;
    justify-content: center;
}

.cs-pagination .pagination {
    margin: 0;
}

.cs-pagination li {
    list-style: none;
}

.cs-pagination li a,
.cs-pagination li span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid rgba(110, 230, 110, 0.5);
    border-radius: 4px;
    color: #6ee66e;
    text-decoration: none;
    font-size: 16px;
    background: #000;
    margin: 0 2px;
}

.cs-pagination li.active a,
.cs-pagination li.active span {
    background: #1a3d1a;
    border-color: #6ee66e;
}

.cs-pagination li.disabled span {
    color: #555;
    border-color: #333;
}

/* Score breakdown badges */
.cs-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.cs-breakdown-badge {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(110, 230, 110, 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    white-space: nowrap;
}

/* Player profile stats */
.cs-stats-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.cs-stat-card {
    background: #0a0a0a;
    border: 2px solid #6ee66e;
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    min-width: 120px;
}

.cs-stat-card .cs-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #6ee66e;
    text-shadow: 0 0 8px rgba(110, 230, 110, 0.5);
}

.cs-stat-card .cs-stat-label {
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
}

/* Section heading */
.cs-section-title {
    font-size: 1.4rem;
    color: #6ee66e;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(110, 230, 110, 0.3);
}

/* 2P player name display */
.cs-players {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.cs-players .cs-player2 {
    font-size: 14px;
    opacity: 0.8;
}
