/* ─── Reviews Section ─────────────────────────────────────────────────────── */

.reviews-section {
    margin-top: 28px;
}

.reviews-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(93, 148, 0, 0.4);
    color: inherit;
}

/* ─── Auth gate ───────────────────────────────────────────────────────────── */

/* hidden-атрибут должен скрывать flex-контейнеры (browser default [hidden]{display:none} перебивается display:flex ниже) */
.reviews-auth-gate[hidden],
.reviews-form[hidden],
.reviews-own-status[hidden] {
    display: none !important;
}

.reviews-auth-gate {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    background: rgba(93, 148, 0, 0.06);
    border: 1px dashed rgba(93, 148, 0, 0.35);
    margin-bottom: 16px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.reviews-auth-gate p {
    margin: 0;
    opacity: 0.8;
}

/* ─── Form ────────────────────────────────────────────────────────────────── */

.reviews-form {
    margin-bottom: 20px;
}

.reviews-form__header {
    margin-bottom: 8px;
}

.reviews-form__badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(93, 148, 0, 0.12);
    border: 1px solid rgba(93, 148, 0, 0.3);
    color: #5d9400;
    font-weight: 600;
}

.reviews-form__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(93, 148, 0, 0.3);
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

[data-theme="light"] .reviews-form__textarea {
    background: #fff;
    border-color: #c5d98a;
}

.reviews-form__textarea:focus {
    border-color: #5d9400;
    box-shadow: 0 0 0 3px rgba(93, 148, 0, 0.12);
}

.reviews-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.reviews-form__counter {
    font-size: 0.8rem;
    opacity: 0.5;
    transition: color 0.2s, opacity 0.2s;
}

.reviews-form__counter--ok {
    color: #5d9400;
    opacity: 1;
}

.reviews-form__counter--warn {
    color: #f59e0b;
    opacity: 1;
}

.reviews-form__hint {
    margin-top: 6px;
    font-size: 0.78rem;
    opacity: 0.5;
    font-style: italic;
}

/* ─── Own status ──────────────────────────────────────────────────────────── */

.own-status {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-left: 3px solid transparent;
}

.own-status--pending {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: #f59e0b;
}

.own-status--approved {
    background: rgba(93, 148, 0, 0.08);
    border-left-color: #5d9400;
}

.own-status--rejected {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: #ef4444;
}

.own-status__label {
    font-weight: 700;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 4px;
}

.own-status__hint {
    font-size: 0.82rem;
    opacity: 0.7;
    margin: 4px 0 0;
}

.own-status__hint--edit {
    color: #f59e0b;
}

.own-status__note {
    font-size: 0.82rem;
    color: #ef4444;
    margin: 4px 0 0;
}

/* ─── Reviews list ────────────────────────────────────────────────────────── */

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reviews-empty {
    opacity: 0.5;
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 24px 0;
}

/* ─── Review card ─────────────────────────────────────────────────────────── */

.review-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(93, 148, 0, 0.2);
    background: #363a37;
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 14px 16px;
    padding-left: 20px;
}

[data-theme="light"] .review-card {
    background: #fff;
    border-color: #dce9b0;
}

.review-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .review-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Left color bar by rarity */
.review-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 10px 0 0 10px;
}

.review-card--grey::before   { background: #9ca3af; }
.review-card--green::before  { background: #22c55e; }
.review-card--blue::before   { background: #3b82f6; }
.review-card--purple::before { background: #a855f7; }
.review-card--gold::before   { background: #f59e0b; }
.review-card--legendary::before {
    background: linear-gradient(180deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #a855f7);
}

/* ─── Card head ───────────────────────────────────────────────────────────── */

.review-card__head {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 10px;
}

.review-card__avatar-link {
    flex-shrink: 0;
    text-decoration: none;
}

.review-card__avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #9ca3af;
    box-sizing: border-box;
    flex-shrink: 0;
}

.review-card__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.review-card__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.review-card__name {
    font-weight: 700;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.review-card__name:hover {
    color: #5d9400;
}

.review-card__date {
    font-size: 0.75rem;
    opacity: 0.5;
    white-space: nowrap;
}

.review-card__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ─── Rank & level badges ─────────────────────────────────────────────────── */

.review-own-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(93, 148, 0, 0.15);
    border: 1px solid rgba(93, 148, 0, 0.4);
    color: #5d9400;
    white-space: nowrap;
}

.review-level-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(93, 148, 0, 0.15);
    border: 1px solid rgba(93, 148, 0, 0.3);
    color: #5d9400;
    white-space: nowrap;
}

.review-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid currentColor;
    opacity: 0.9;
    white-space: nowrap;
}

[data-theme="light"] .review-rank-badge {
    background: rgba(0, 0, 0, 0.04);
}

.review-rank-badge--legendary {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(168,85,247,0.15));
    border: 1px solid transparent;
    background-clip: padding-box;
    animation: legendaryShimmer 3s linear infinite;
    color: #f97316;
}

@keyframes legendaryShimmer {
    0%   { color: #ef4444; }
    20%  { color: #f97316; }
    40%  { color: #eab308; }
    60%  { color: #22c55e; }
    80%  { color: #3b82f6; }
    100% { color: #a855f7; }
}

/* ─── Vote & report buttons ───────────────────────────────────────────────── */

.review-like-btn,
.review-dislike-btn,
.review-report-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.78rem;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.55;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

[data-theme="light"] .review-like-btn,
[data-theme="light"] .review-dislike-btn,
[data-theme="light"] .review-report-btn {
    border-color: rgba(0, 0, 0, 0.12);
}

.review-like-btn:hover,
.review-dislike-btn:hover,
.review-report-btn:hover {
    opacity: 1;
}

.review-like-btn:hover,
.review-like-btn--active {
    color: #22c55e;
    border-color: #22c55e;
    opacity: 1;
}

.review-dislike-btn:hover,
.review-dislike-btn--active {
    color: #ef4444;
    border-color: #ef4444;
    opacity: 1;
}

.review-report-btn:hover {
    color: #f59e0b;
    border-color: #f59e0b;
}

.review-like-btn:disabled,
.review-dislike-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ─── Card body ───────────────────────────────────────────────────────────── */

.review-card__body {
    font-size: 0.88rem;
    line-height: 1.65;
    opacity: 0.85;
}

.review-card__body p {
    margin: 0 0 8px;
}

.review-card__body p:last-child {
    margin-bottom: 0;
}

/* ─── More button ─────────────────────────────────────────────────────────── */

.reviews-more-wrap {
    text-align: center;
    margin-top: 16px;
}
