/* *** Shared IdleDB utilities *** */

/* List container + rows */
.list-container {
    border-radius: 0.75rem;
    border: 1px solid rgb(38 38 38);
    background-color: rgb(38 38 38 / 0.3);
    overflow: hidden;
}
.list-row {
    padding: 0.75rem;
    border-bottom: 1px solid rgb(38 38 38 / 0.6);
    transition: background-color 0.15s ease;
}
@media (min-width: 640px) {
    .list-row { padding: 1rem; }
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background-color: rgb(38 38 38 / 0.5); }

/* Rank badges */
.rank-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.8rem;
    background-color: rgb(38 38 38);
    color: rgb(163 163 163);
}
.rank-badge--1 {
    background: linear-gradient(135deg, #f59e0b 0%, #fcd34d 100%);
    color: #3a1d03;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(245, 158, 11, 0.18);
}
.rank-badge--2 {
    background: linear-gradient(135deg, #94a3b8 0%, #e2e8f0 100%);
    color: #1f2937;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4), 0 4px 12px rgba(148, 163, 184, 0.18);
}
.rank-badge--3 {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    color: #2b1202;
    box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.4), 0 4px 12px rgba(180, 83, 9, 0.18);
}

/* Stat ribbon */
.stat-sep {
    color: rgb(82 82 82);
    user-select: none;
    margin: 0 0.25rem;
}

/* Tag chip */
.tag-chip {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background-color: rgb(168 85 247 / 0.15);
    color: rgb(216 180 254);
    font-size: 11px;
    line-height: 1.2rem;
    white-space: nowrap;
}

/* Vote buttons */
.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1;
    gap: 0.25rem;
    background-color: rgb(38 38 38);
    color: rgb(163 163 163);
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}
.vote-btn:hover { background-color: rgb(64 64 64); color: white; }
.vote-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.6);
}
.vote-btn--up-active {
    background-color: rgb(34 197 94 / 0.18);
    color: rgb(74 222 128);
    border-color: rgb(34 197 94 / 0.4);
}
.vote-btn--up-active:hover {
    background-color: rgb(34 197 94 / 0.24);
    color: rgb(134 239 172);
}
.vote-btn--down-active {
    background-color: rgb(239 68 68 / 0.18);
    color: rgb(248 113 113);
    border-color: rgb(239 68 68 / 0.4);
}
.vote-btn--down-active:hover {
    background-color: rgb(239 68 68 / 0.24);
    color: rgb(252 165 165);
}

/* Store link button */
.store-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    transition: filter 0.15s ease;
}
.store-btn:hover { filter: brightness(1.1); }

/* Game row card layout */
.game-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}
@media (min-width: 640px) {
    .game-row { gap: 1rem; align-items: center; }
}
.game-row__image {
    flex-shrink: 0;
    position: relative;
}
.game-row__image img {
    width: 5rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 0.375rem;
}
@media (min-width: 640px) {
    .game-row__image img {
        width: 6rem;
        height: 3.5rem;
    }
}
.game-row__body {
    flex: 1;
    min-width: 0;
}
.game-row__name {
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    line-height: 1.3;
}
.game-row__name:hover { color: rgb(216 180 254); }
.game-row__stats {
    margin-top: 0.375rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0;
    font-size: 0.8rem;
    color: rgb(212 212 212);
}
.game-row__stats .rating-pos { color: rgb(74 222 128); font-weight: 600; }
.game-row__stats .rating-mid { color: rgb(250 204 21); font-weight: 600; }
.game-row__stats .rating-low { color: rgb(248 113 113); font-weight: 600; }
.game-row__stats .free       { color: rgb(74 222 128); font-weight: 600; }
.game-row__stats .muted      { color: rgb(115 115 115); }
.game-row__tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.game-row__actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}
@media (max-width: 639px) {
    .game-row__actions {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgb(38 38 38 / 0.6);
        width: 100%;
    }
}

/* NSFW blur (kept from previous pages) */
.nsfw-blur {
    filter: blur(8px);
    transition: filter 0.2s ease;
}

/* *** Modal polish *** */
.modal-section-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(163 163 163);
    margin-bottom: 0.75rem;
}

.modal-stat-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0;
    font-size: 0.875rem;
    color: rgb(212 212 212);
}
.modal-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
}
.modal-stat__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(115 115 115);
    font-weight: 600;
}

.modal-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    transition: all 0.15s ease;
    box-shadow: 0 4px 14px -4px rgba(139, 92, 246, 0.4);
}
.modal-cta-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px -4px rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

.modal-description {
    background-color: rgb(23 23 23 / 0.5);
    border: 1px solid rgb(38 38 38);
    border-radius: 0.75rem;
    padding: 1.125rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgb(212 212 212);
    max-height: 16rem;
    overflow-y: auto;
}
.modal-description::-webkit-scrollbar { width: 6px; }
.modal-description::-webkit-scrollbar-thumb { background-color: rgb(82 82 82); border-radius: 3px; }

/* Media gallery */
.media-stage {
    position: relative;
    margin-bottom: 0.625rem;
    aspect-ratio: 16 / 9;
    background-color: black;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgb(38 38 38);
}
.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgb(0 0 0 / 0.6);
    color: white;
    backdrop-filter: blur(4px);
    transition: background-color 0.15s ease;
}
.media-nav:hover { background-color: rgb(0 0 0 / 0.85); }
.media-nav--left { left: 0.5rem; }
.media-nav--right { right: 0.5rem; }

.media-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}
.media-thumbs::-webkit-scrollbar { height: 6px; }
.media-thumbs::-webkit-scrollbar-thumb { background-color: rgb(64 64 64); border-radius: 3px; }

.media-thumb {
    position: relative;
    flex-shrink: 0;
    width: 6rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    background-color: rgb(23 23 23);
    transition: all 0.15s ease;
    cursor: pointer;
    padding: 0;
}
.media-thumb:hover { border-color: rgb(115 115 115); }
.media-thumb--active {
    border-color: rgb(168 85 247);
    box-shadow: 0 0 0 3px rgb(168 85 247 / 0.25);
}
.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.media-thumb__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(0 0 0 / 0.4);
    color: white;
}

/* Similar game card */
.similar-game {
    display: block;
    padding: 0.5rem;
    background-color: rgb(38 38 38 / 0.5);
    border: 1px solid rgb(38 38 38);
    border-radius: 0.625rem;
    transition: all 0.15s ease;
}
.similar-game:hover {
    background-color: rgb(64 64 64 / 0.5);
    border-color: rgb(82 82 82);
    transform: translateY(-1px);
}
.similar-game__img {
    width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin-bottom: 0.375rem;
    object-fit: cover;
    display: block;
}
.similar-game__img--ios {
    width: 3rem;
    height: 3rem;
    margin-left: auto;
    margin-right: auto;
}
.similar-game__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(212 212 212);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
