body {
    font-family: Arial, sans-serif;
    background: #0e0e10;
    color: white;
    padding: 10px 20px;
    margin: 0;
}

h1 {
    text-align: center;
    margin: 6px 0 6px 0;
}

.hidden {
    display: none !important;
}

.sort-bar {
    text-align: center;
    margin-bottom: 10px;
}

.sort-bar span {
    color: #adadb8;
    font-size: 14px;
    margin-right: 6px;
}

.sort-bar a {
    display: inline-block;
    background: #9146ff;
    color: white;
    text-decoration: none;
    padding: 10px;
    margin: 5px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.sort-bar a:hover {
    background: #772ce8;
}

.sort-bar a.active-sort {
    background: #ED46FF;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.16);
}

.thumb-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    background: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 14px;
    color: #adadb8;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.thumb-toggle:hover {
    border-color: #9146ff;
    color: white;
    box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.15);
}

.thumb-toggle input {
    display: none;
}

.thumb-switch {
    width: 36px;
    height: 18px;
    background: #2f2f35;
    border-radius: 999px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.thumb-switch::after {
    content: "";
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.thumb-toggle input:checked + .thumb-switch {
    background: #9146ff;
}

.thumb-toggle input:checked + .thumb-switch::after {
    transform: translateX(18px);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.update-info {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 0;
    background: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 14px;
    color: #adadb8;
    font-weight: bold;
    text-align: right;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.page-width {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.map-card {
    width: 320px;
    background: #18181b;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid transparent;
}

.map-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

.titleWrap {
    position: relative;
}

.map-name {
    margin: 0 0 6px 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: bold;
}

.thumbWrap {
    position: relative;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
}

.thumbWrap > img.map-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewsBadge,
.gpsBadge,
.clipsBadge {
    position: absolute;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
}

.viewsBadge {
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.8);
}

.gpsBadge {
    top: 6px;
    right: 6px;
}

.clipsBadge {
    bottom: 6px;
    right: 6px;
    background: orange;
    color: black;
    font-weight: bold;
}

.gpsYes { background: green; }

.gpsUser {
    background: orange;
    color: black;
}

.gpsNo { background: red; }

#selectedBox {
    max-width: 1280px;
    margin: 20px auto;
    background: #18181b;
    padding: 14px;
    border-radius: 10px;
    border: 3px solid transparent;
}

.selectedLayout {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.selectedMain {
    width: 900px;
    flex-shrink: 0;
}

#gpsPlayer iframe {
    width: 100%;
    height: 500px;
    border-radius: 10px;
}

#userClipsBox {
    margin: 18px auto 0 auto;
}

.user-clips-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #0e0e10;
    cursor: pointer;
    user-select: none;
}

.user-clips-table th,
.user-clips-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2f2f35;
    vertical-align: middle;
    text-align: left;
}

.user-clips-table th:hover {
    color: #9146ff;
}

.user-clips-table thead {
    background: #1f1f23;
}

.user-clips-table th {
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.user-clips-table td {
    color: #e6e6ea;
    font-size: 14px;
}

.user-clips-table th:nth-child(1),
.user-clips-table td:nth-child(1) {
    width: 40px;
    text-align: center;
}

.user-clips-table th:nth-child(2),
.user-clips-table td:nth-child(2) {
    width: 150px;
}

.user-clips-table th:nth-child(3),
.user-clips-table td:nth-child(3) {
    width: auto;
}

.user-clips-table th:nth-child(4),
.user-clips-table td:nth-child(4) {
    width: 130px;
}

.user-clips-table th:nth-child(5),
.user-clips-table td:nth-child(5) {
    width: 72px;
    text-align: center;
}

.user-clips-table th:nth-child(6),
.user-clips-table td:nth-child(6),
.user-clips-table th:nth-child(7),
.user-clips-table td:nth-child(7) {
    width: 80px;
    text-align: center;
}

.user-clips-table tbody tr:hover {
    background: rgba(145, 70, 255, 0.12);
}

.user-clips-table tr.activeRow {
    background: rgba(145, 70, 255, 0.3) !important;
}

.clip-player {
    font-weight: bold;
}

.clip-host {
    color: #adadb8;
}

.clip-host-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-host-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.iconButton {
    min-width: 38px;
    padding-left: 10px;
    padding-right: 10px;
}

.user-clips-table td.clip-host {
    text-align: center;
}

.noWatch {
    color: #adadb8;
}

.button {
    display: inline-block;
    background: #9146ff;
    color: white;
    border: 0;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover {
    background: #772ce8;
}

.button.small {
    padding: 6px 12px;
}

.secondaryButton {
    background: #2f2f35;
}

.secondaryButton:hover {
    background: #3f3f46;
}

.clip-form {
    margin: 16px auto;
    max-width: 620px;
    display: flex;
    gap: 8px;
}

.clip-form input {
    flex: 1;
    min-width: 0;
    background: #0e0e10;
    border: 1px solid #2f2f35;
    padding: 10px;
    color: white;
}

#commentsBox {
    width: 340px;
    background: #0e0e10;
    border: 1px solid #2f2f35;
    border-radius: 10px;
    padding: 12px;
}

#commentsList {
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.comment-form input,
.comment-form textarea {
    background: #0e0e10;
    border: 1px solid #2f2f35;
    color: white;
    padding: 10px;
    border-radius: 6px;
}

.comment-form textarea {
    min-height: 90px;
}

.comment {
    background: #0e0e10;
    border: 1px solid #2f2f35;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.commentMeta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #adadb8;
    margin-bottom: 6px;
}

.commentText {
    white-space: pre-wrap;
    line-height: 1.4;
    margin-bottom: 8px;
}

.commentActions {
    display: flex;
    gap: 8px;
}

.comment.editing {
    padding: 10px;
}

.comment.editing .commentText {
    margin-bottom: 8px;
}

.commentEditInput,
.commentEditTextarea {
    width: 100%;
    background: #0e0e10;
    border: 1px solid #9146ff;
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.commentEditInput {
    height: 34px;
    margin-bottom: 8px;
}

.commentEditTextarea {
    height: 70px;
    resize: none;
    overflow-y: auto;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modalInner {
    position: relative;
    z-index: 100000;
    background: #18181b;
    padding: 20px;
    border-radius: 10px;
}

.empty-text,
.success,
.error {
    background: #18181b;
    border: 1px solid #2f2f35;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
    text-align: center;
}

.success {
    color: #7CFF7C;
}

.error {
    color: #ff7777;
}

.subtitle {
    text-align: center;
    font-size: 13px;
    color: #adadb8;
    margin-top: -4px;
    margin-bottom: 10px;
}

.map-author a,
.selected-author a {
    color: #b892ff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.15s ease;
}

.map-author a:visited,
.selected-author a:visited {
    color: #b892ff;
}

.map-author a:hover,
.selected-author a:hover {
    color: #ffffff;
}

.map-medals,
.selected-medals {
    justify-content: flex-start;
    font-size: 14px;
    margin-bottom: 14px;
}

.map-medals > span,
.selected-medals > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.map-medals img,
.selected-medals img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.selected-author {
    font-size: 15px;
    color: #adadb8;
    margin-top: 4px;
    margin-bottom: 8px;
}

.selected-medals {
    justify-content: center;
    font-size: 14px;
    margin-bottom: 14px;
}

.selected-medals img {
    width: 20px;
    height: 20px;
}

.map-author .flag-icon,
.selected-author .flag-icon {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    margin-top: -2px;
}

.tooltipWrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.tooltipWrap .tooltip {
    display: none;
}

.tooltipWrap:hover .tooltip {
    display: block;
}

.search-bar {
    display: flex;
    justify-content: center;
    margin: 6px 0 18px 0;
}

.search-bar input {
    width: 420px;
    max-width: 90vw;
    background: #111114;
    border: 2px solid #2f2f35;
    color: white;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.search-bar input::placeholder {
    color: #7d7d88;
    font-weight: 500;
}

.search-bar input:focus {
    border-color: #9146ff;
    background: #16161a;
    box-shadow: 0 0 0 4px rgba(145, 70, 255, 0.12);
}

@media (max-width: 1300px) {
    #selectedBox {
        max-width: 900px;
    }

    .selectedLayout {
        flex-direction: column;
    }

    .selectedMain {
        width: 100%;
    }

    #commentsBox {
        width: 100%;
        margin-top: 18px;
    }
}

.clip-video {
    display: block;
    width: 100%;
    height: 500px;
    object-fit: contain;
    background: #000;
    border-radius: 10px;
}

.noComment {
    color: #777;
}

.selected-map-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.selected-map-title a,
.selected-map-title a:visited {
    color: #c084ff;
    text-decoration: underline;
    font-weight: 800;
    transition: color 0.15s ease;
}

.selected-map-title a:hover {
    color: #ffffff;
}

.selected-map-title img {
    height: 1em;
    width: 1em;
    object-fit: contain;
}

#selectedTitle {
    margin-top: 0;
    padding-top: 0;
}

.map-card.border-white,
#selectedBox.border-white {
    border-color: rgba(255, 255, 255, 0.45);
}

.map-card.border-green,
#selectedBox.border-green {
    border-color: rgba(34, 197, 94, 0.45);
}

.map-card.border-blue,
#selectedBox.border-blue {
    border-color: rgba(59, 130, 246, 0.45);
}

.map-card.border-red,
#selectedBox.border-red {
    border-color: rgba(239, 68, 68, 0.45);
}

.map-card.border-black,
#selectedBox.border-black {
    border-color: #000000;
}