/* Map elimination / map vote page – mobile-first, responsive */

.map-vote-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.map-vote-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    background: #990000;
    color: #fff;
    border-radius: 4px;
}

.map-vote-header-title {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

.map-vote-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.map-vote-header-right #pinned-counter {
    font-weight: bold;
    color: #fff;
}

.map-vote-header .map-vote-submit {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.8);
}
.map-vote-header .map-vote-submit:hover:not(:disabled) {
    background: #b30000;
    border-color: #fff;
}

.map-vote-intro {
    color: #444;
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}

.map-vote-instructions {
    color: #444;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-align: center;
}

.map-vote-btn {
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid #999;
    background: #fff;
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
}

.map-vote-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #666;
}

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

.map-vote-submit {
    background: #990000;
    color: #fff;
    border-color: #990000;
}

.map-vote-submit:hover:not(:disabled) {
    background: #b30000;
    border-color: #b30000;
}

/* Responsive grid – maximize tile size per screen. Mobile: 2×6 → Medium: 3×4 → Hi-res: 4×3 large */
.map-vote-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(6px, 2vw, 10px);
    margin-bottom: 1rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 600px) {
    .map-vote-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: clamp(8px, 1.5vw, 14px);
    }
}

@media (min-width: 960px) {
    .map-vote-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: clamp(10px, 1.2vw, 16px);
        max-width: 1056px;
    }
}

.map-vote-tile {
    aspect-ratio: 1;
    min-height: 80px;
    border: 2px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
}

.map-vote-tile.pinned {
    border-color: #990000;
    background: #fff5f5;
    box-shadow: 0 0 0 2px rgba(153, 0, 0, 0.3);
}

.map-vote-tile.pinned:active {
    animation: map-vote-shake 0.3s ease;
}

@keyframes map-vote-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.map-vote-tile-img-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    position: relative;
}

.map-vote-metascore {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    z-index: 1;
    line-height: 1.2;
}

.map-vote-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-vote-tile-info {
    padding: 4px 6px;
    font-size: clamp(0.65rem, 2vw, 0.8rem);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.map-vote-tile-name {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.map-vote-tile-meta {
    color: #666;
    font-size: 0.85em;
}

.map-vote-tile-plays {
    flex-shrink: 0;
    margin-left: auto;
}

.map-vote-tile-pin-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #990000;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 1;
}

.map-vote-msg {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.map-vote-lookup-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    text-align: center;
}

.map-vote-lookup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.map-vote-lookup-label {
    font-weight: bold;
    flex-shrink: 0;
}

.map-vote-lookup-input {
    flex: 1;
    min-width: 140px;
    max-width: 320px;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid #999;
    border-radius: 4px;
}

.map-lookup-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.map-lookup-result-item {
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.map-lookup-result-item:hover {
    background: #f0f0f0;
}

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

.map-vote-reset-btn {
    background: #666;
    color: #fff;
    border-color: #666;
}

.map-vote-reset-btn:hover {
    background: #555;
    border-color: #555;
}

.map-vote-success {
    margin-top: 1rem;
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
}

.map-vote-success h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.map-vote-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.map-vote-summary-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.map-vote-summary-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.map-vote-summary-item .name {
    padding: 4px 6px;
    font-weight: bold;
    font-size: 0.85rem;
}

.map-vote-summary-item .meta {
    padding: 2px 6px 6px;
    font-size: 0.75rem;
    color: #666;
}

/* Map details modal – centered, click-outside or X to close, links work */
.map-vote-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.map-vote-modal-backdrop[hidden] {
    display: none;
}

.map-vote-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.map-vote-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.map-vote-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: #222;
    line-height: 1.2;
}

.map-vote-modal-title-score {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    margin-left: 8px;
    vertical-align: middle;
}

.map-vote-modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
}

.map-vote-modal-close:hover {
    background: #e0e0e0;
    color: #222;
}

.map-vote-modal-body {
    padding: 16px;
}

.map-vote-modal-imgs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.map-vote-modal-imgs img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.map-vote-modal-desc {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #444;
    margin-bottom: 12px;
}

.map-vote-modal-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
}

.map-vote-modal-detail-row {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 6px;
}

.map-vote-modal-detail-label {
    font-weight: 600;
    color: #333;
    margin-right: 6px;
}

.map-vote-modal-meta-score {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    margin-right: 4px;
}

.map-vote-modal-links {
    font-size: 0.9rem;
}

.map-vote-modal-links a {
    color: #990000;
    text-decoration: none;
}

.map-vote-modal-links a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .map-vote-modal-imgs img {
        width: 80px;
        height: 80px;
    }
}
