.my-maps-page {
    min-height: 70vh;
    padding: 3rem 1.25rem 5rem;
}

body.modal-open {
    overflow: hidden;
}

.my-maps-heading,
.my-maps-section {
    width: min(100%, 68rem);
}

.my-maps-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
    text-align: left;
}

.my-maps-heading .title {
    margin: 0.2rem 0 0.45rem;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.1;
    text-align: left;
}

.my-maps-heading .panel-description {
    max-width: 36rem;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
}

.my-maps-heading-art {
    display: block;
    flex: 0 1 10rem;
    width: 10rem;
    max-width: 22%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 255, 174, 0.12));
}

.eyebrow {
    margin: 0;
    color: var(--geo-accent-strong, #00f5b3);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.create-map-button {
    display: inline-flex;
    min-height: 2.8rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(0, 255, 174, 0.7);
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #00f5b3, #00c78a);
    color: #031a15;
    box-shadow: 0 7px 18px rgba(0, 255, 174, 0.16);
    font-size: 0.92rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.create-map-button:hover {
    background: linear-gradient(135deg, #54ffce, #00d99a);
    color: #031a15;
}

.my-maps-section {
    box-sizing: border-box;
    padding: 1.5rem;
}

.my-maps-section h2 {
    margin: 0;
    color: var(--geo-text, #f4fff9);
    font-size: 1.28rem;
}

.my-maps-section .line {
    height: 1px;
    margin: 1rem 0 1.25rem;
    opacity: 0.7;
}

.my-maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 0.9rem;
}

.my-map-card {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    align-items: start;
    gap: 0.85rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(150, 255, 220, 0.14);
    border-radius: 0.85rem;
    background: rgba(7, 15, 18, 0.42);
    text-align: left;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease;
}

.my-map-card:hover {
    border-color: rgba(0, 255, 174, 0.42);
    background: rgba(7, 15, 18, 0.62);
}

.my-map-thumbnail {
    width: 4.75rem;
    height: 4.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.7rem;
    object-fit: cover;
}

.my-map-skeleton {
    pointer-events: none;
}

.my-map-skeleton .my-map-thumbnail {
    display: block;
    border: 0;
}

.my-map-skeleton-lines {
    display: grid;
    gap: 0.55rem;
    align-content: center;
    min-height: 4.75rem;
}

.my-map-skeleton-lines .skeleton-line:nth-child(1) {
    width: 72%;
}
.my-map-skeleton-lines .skeleton-line:nth-child(2) {
    width: 96%;
}
.my-map-skeleton-lines .skeleton-line:nth-child(3) {
    width: 48%;
}

.my-map-main {
    display: flex;
    min-width: 0;
    min-height: 4.75rem;
    flex-direction: column;
    align-items: stretch;
}

.my-map-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.my-map-card-heading h3 {
    overflow: hidden;
    margin: 0;
    color: #f5fff9;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.difficulty-pill {
    flex: 0 0 auto;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.65rem;
    font-weight: 700;
}

.difficulty-pill.easy {
    color: #7bf2bf;
}
.difficulty-pill.medium {
    color: #ffd27d;
}
.difficulty-pill.hard {
    color: #ff9b9b;
}

.my-map-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0.32rem 0 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.my-map-date {
    margin: 0.32rem 0 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.68rem;
}

.my-map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.map-action {
    display: inline-flex;
    min-height: 1.9rem;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.62rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.map-action:hover {
    background: rgba(255, 255, 255, 0.09);
}
.map-action.play-action {
    border-color: rgba(0, 255, 174, 0.4);
    color: #8affd8;
}
.map-action.play-action:hover {
    background: rgba(0, 255, 174, 0.12);
}
.map-action.delete-action {
    color: #ff9c9c;
}
.map-action.delete-action:hover {
    border-color: rgba(255, 130, 130, 0.5);
    background: rgba(255, 80, 80, 0.1);
}

.maps-loading {
    grid-column: 1 / -1;
    margin: 0;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-size: 0.9rem;
}

.error-state {
    color: #ffaaaa;
}

.empty-grid {
    display: block;
}

.maps-empty-state {
    display: flex;
    min-height: 15rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    border: 1px dashed rgba(150, 255, 220, 0.22);
    border-radius: 0.9rem;
    background: radial-gradient(ellipse at top, rgba(0, 255, 174, 0.07), transparent 65%);
    text-align: center;
}

.empty-map-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(0, 255, 174, 0.28);
    border-radius: 1rem;
    background: rgba(0, 255, 174, 0.08);
    color: #78ffd2;
    font-size: 1.6rem;
}

.maps-empty-state h3 {
    margin: 0;
    color: #f4fff9;
    font-size: 1.05rem;
}
.maps-empty-state p {
    max-width: 27rem;
    margin: 0.45rem 0 1rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
    line-height: 1.5;
}
.maps-empty-state .create-map-button {
    min-height: 2.4rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
}

.map-dialog {
    width: min(68rem, calc(100% - 2rem));
    max-height: min(90vh, 52rem);
    padding: 1.35rem;
    overflow-y: auto;
    animation: dialog-arrive 180ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.map-dialog.confirm-dialog {
    width: min(34rem, calc(100% - 2rem));
}

@keyframes dialog-arrive {
    from {
        opacity: 0;
        transform: translateY(0.55rem) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dialog-button:focus-visible,
.difficulty-trigger:focus-visible,
.difficulty-options button:focus-visible,
.tag-picker .tag-chip:focus-visible {
    outline: 2px solid #65f0bd;
    outline-offset: 2px;
}
.map-dialog-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.map-dialog-form label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 650;
}
.map-dialog-form label span {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}
.map-dialog-form input,
.map-dialog-form textarea,
.map-dialog-form select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
}
.map-dialog-form input:not([type="radio"]),
.map-dialog-form textarea,
.map-dialog-form select {
    box-sizing: border-box;
    border: 1px solid rgba(159, 255, 220, 0.2);
    border-radius: 0.55rem;
    background-color: #091318 !important;
    color: #f4fff9 !important;
    color-scheme: dark;
}
.map-dialog-form input:-webkit-autofill,
.map-dialog-form textarea:-webkit-autofill,
.map-dialog-form select:-webkit-autofill {
    -webkit-text-fill-color: #f4fff9;
    box-shadow: 0 0 0 1000px #091318 inset;
}
.map-dialog-form input:focus,
.map-dialog-form textarea:focus,
.map-dialog-form select:focus {
    outline: 2px solid rgba(0, 255, 174, 0.45);
    outline-offset: 1px;
}
.map-dialog-form textarea {
    resize: vertical;
}
.map-dialog-form #create-map-description,
.map-dialog-form #edit-map-description {
    min-height: 5.5rem;
}
.map-dialog-form #create-map-locations,
.map-dialog-form #edit-map-locations {
    min-height: 15rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
}
.map-dialog-form .map-form-fields {
    display: grid;
    position: relative;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.5rem;
}
.map-dialog-form .map-form-fields::after {
    position: absolute;
    top: 0.25rem;
    left: 50%;
    width: 1px;
    height: 4.8rem;
    background: rgba(150, 255, 220, 0.16);
    content: "";
}
.map-form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.4rem;
}
.map-form-field.difficulty-field {
    grid-column: 2;
}
.map-form-field.description-field {
    grid-column: 1 / -1;
}
.map-form-field.locations-field,
.map-form-field.view-field {
    width: 100%;
}
.view-picker {
    width: 100%;
    height: 14rem;
    border: 1px solid rgba(159, 255, 220, 0.24);
    border-radius: 0.6rem;
    overflow: hidden;
}
.view-help {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}
.form-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 650;
}
.difficulty-control {
    position: relative;
    width: 100%;
}
.difficulty-trigger {
    display: flex;
    width: 100%;
    min-height: 2.65rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(159, 255, 220, 0.24);
    border-radius: 0.6rem;
    background: linear-gradient(145deg, rgba(12, 29, 34, 0.98), rgba(7, 18, 22, 0.98));
    color: #f4fff9;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}
.difficulty-trigger:hover,
.difficulty-trigger[aria-expanded="true"] {
    border-color: rgba(0, 255, 174, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 255, 174, 0.1);
}
.difficulty-trigger:hover {
    transform: translateY(-1px);
}
.difficulty-trigger:active {
    transform: translateY(0) scale(0.995);
}
.difficulty-value-easy {
    color: #78efb7;
}
.difficulty-value-medium {
    color: #ffd17d;
}
.difficulty-value-hard {
    color: #ff9b9b;
}
.difficulty-chevron {
    width: 0.62rem;
    height: 0.62rem;
    flex: 0 0 auto;
    border-right: 2px solid #54e7b2;
    border-bottom: 2px solid #54e7b2;
    transform: rotate(45deg) translateY(-0.16rem);
    transition: transform 0.16s ease;
}
.difficulty-trigger[aria-expanded="true"] .difficulty-chevron {
    transform: rotate(225deg) translate(-0.1rem, -0.1rem);
}
.difficulty-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    display: grid;
    gap: 0.2rem;
    padding: 0.35rem;
    border: 1px solid rgba(150, 255, 220, 0.2);
    border-radius: 0.7rem;
    background: #0c191e;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.55);
    animation: options-arrive 140ms ease-out both;
    transform-origin: top center;
}
.difficulty-options[hidden] {
    display: none;
}
@keyframes options-arrive {
    from {
        opacity: 0;
        transform: translateY(-0.25rem) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.difficulty-options[hidden] {
    display: none;
}
.difficulty-options button {
    width: 100%;
    padding: 0.62rem 0.7rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: rgba(244, 255, 249, 0.86);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    text-align: left;
    transition:
        background-color 140ms ease,
        color 140ms ease,
        padding-left 140ms ease;
}
.difficulty-options button:hover,
.difficulty-options button[aria-selected="true"] {
    background: rgba(0, 255, 174, 0.12);
    color: #9affd9;
}
.difficulty-options button:hover {
    padding-left: 0.9rem;
}
.map-dialog-form .dialog-heading {
    margin-bottom: 0.35rem;
}
.map-dialog-form .tag-picker {
    width: 100%;
}
.tag-picker {
    margin: 0.55rem 0;
    padding: 0.75rem;
    border: 1px solid rgba(150, 255, 220, 0.12);
    border-radius: 0.65rem;
    background: rgba(3, 10, 13, 0.45);
}
.tag-picker h3 {
    margin: 0;
    font-size: 0.9rem;
}
.tag-picker p {
    margin: 0.2rem 0 0.65rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75rem;
}
.tag-picker .tag-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.tag-picker .tag-chip {
    box-sizing: border-box;
    min-height: 2.2rem;
    padding: 0.48rem 0.85rem;
    border: 1px solid rgba(150, 255, 220, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #eaf8f1;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    transform: none !important;
    transition:
        color 150ms ease,
        background-color 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease;
}
.tag-picker .tag-chip:hover {
    border-color: rgba(0, 255, 174, 0.55);
    background: rgba(0, 255, 174, 0.12);
}
.tag-picker .tag-chip.selected {
    border-color: #00d99a;
    background: #00a875;
    color: white;
    box-shadow: 0 0 12px rgba(0, 217, 154, 0.2);
}
.location-mode {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.5rem 0 0;
    padding: 0.7rem;
    border: 1px solid rgba(150, 255, 220, 0.15);
    border-radius: 0.6rem;
}
.location-mode legend {
    padding: 0 0.3rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.78rem;
}
.location-mode label {
    display: flex;
    align-self: stretch;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    margin: 0;
    padding: 0.35rem 0.2rem;
}
.location-mode input {
    flex: 0 0 auto;
    width: auto !important;
    margin: 0;
    accent-color: #00d99a;
}
.location-mode p {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.74rem;
    line-height: 1.45;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.9rem;
}
.dialog-button {
    min-height: 2.35rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    color: #f4fff9;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease;
}
.dialog-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(159, 255, 220, 0.34);
    background-color: rgba(255, 255, 255, 0.1);
}
.dialog-button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}
.dialog-button.primary {
    border-color: rgba(0, 255, 174, 0.55);
    background: #00d99a;
    color: #041811;
}
.dialog-button.primary:hover:not(:disabled) {
    border-color: #70ffd0;
    background: #35e8b1;
    box-shadow: 0 6px 18px rgba(0, 217, 154, 0.2);
}
.dialog-button.danger {
    border-color: rgba(255, 125, 125, 0.45);
    background: rgba(190, 42, 42, 0.85);
    color: white;
}
.dialog-button.danger:hover:not(:disabled) {
    background: #d44848;
    box-shadow: 0 6px 18px rgba(220, 65, 65, 0.18);
}
.dialog-button:disabled {
    cursor: wait;
    opacity: 0.6;
}
.create-map-button,
.map-action {
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease,
        border-color 150ms ease;
}
.create-map-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 255, 174, 0.24);
}
.create-map-button:active {
    transform: translateY(0) scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
    .map-dialog,
    .difficulty-options {
        animation: none;
    }
    .dialog-close,
    .dialog-button,
    .difficulty-trigger,
    .difficulty-options button,
    .tag-picker .tag-chip,
    .create-map-button,
    .map-action {
        transition: none;
    }
}
.dialog-error {
    min-height: 1rem;
    margin: 0.35rem 0 0;
    color: #ffaaaa;
    font-size: 0.78rem;
}
.dialog-error.success-message {
    color: #83f5c7;
}
.confirm-dialog > p:not(.dialog-error) {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    line-height: 1.5;
}

@media (max-width: 620px) {
    .my-maps-page {
        padding-top: 2rem;
    }
    .my-maps-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .my-maps-heading-art {
        display: none;
    }
    .my-maps-section {
        padding: 1rem;
    }
    .my-map-card {
        grid-template-columns: 3.8rem minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.65rem;
    }
    .my-map-thumbnail {
        width: 3.8rem;
        height: 3.8rem;
    }
    .my-map-main {
        min-height: 3.8rem;
    }
    .map-dialog-form {
        gap: 0.65rem;
    }
    .map-dialog-form .map-form-fields {
        grid-template-columns: 1fr;
    }
    .map-dialog-form .map-form-fields::after {
        display: none;
    }
    .map-form-field.description-field {
        grid-column: auto;
    }
    .map-form-field.difficulty-field {
        grid-column: auto;
    }
    .map-dialog-form #create-map-locations,
    .map-dialog-form #edit-map-locations {
        min-height: 11rem;
    }
}
