
:root {
    --bg: #0f1115;
    --surface: #191c22;
    --surface-2: #20242c;
    --surface-3: #2a2f3a;
    --border: #2c323d;
    --border-soft: rgba(255, 255, 255, 0.04);
    --text: #e6e9ef;
    --muted: #a9b2c3;
    --muted-2: #7f8797;
    --accent: #3fa9f5;
    --accent-strong: #4dc1ff;
    --accent-soft: rgba(79, 182, 255, 0.18);
    --danger: #e25c5c;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
    --radius: 10px;
    --radius-lg: 14px;

    /* WIDEN SITE a bit */
    --content-max: 2340px;

    --font: "Segoe UI", system-ui, -apple-system, "Inter", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

a:hover {
    color: var(--accent-strong);
}

.app-body {
    min-height: 100vh;
}

.app-shell {
    display: block;
    min-height: 100vh;
}

.app-main {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.topbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: #15181f;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text);
    border-radius: 8px;
    transition: color 0.15s ease;
}

.topbar-home svg {
    width: 18px;
    height: 18px;
}

.topbar-home:hover {
    color: var(--accent-strong);
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.topbar-search {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px 6px 14px;
    gap: 10px;
    min-width: 260px;
}

.topbar-search input {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.topbar-search button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: var(--accent);
    cursor: pointer;
    position: relative;
}

.topbar-search button::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
}

.topbar-search button::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform: rotate(45deg);
    right: 8px;
    bottom: 9px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-button:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.person-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.user-menu-button {
    color: #fff;
}

.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    min-width: 190px;
    padding: 6px 0;
    z-index: 20;
}

.user-menu-identity {
    padding: 10px 14px;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.user-menu-item {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.user-menu-item:hover {
    background: var(--surface-2);
    color: var(--accent-strong);
}

.hidden {
    display: none;
}

.action-chip {
    padding: 8px 12px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.action-chip.primary {
    background: var(--accent);
    color: #0b0c0f;
    border-color: var(--accent);
}

.action-chip.ghost {
    background: transparent;
}

.action-chip:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.action-chip.primary:hover {
    background: var(--accent-strong);
    color: #0b0c0f;
}

.user-chip {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface);
}

.content-area {
    flex: 1;
    padding: 24px;
}

.content-width {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}

h1, h2, h3, h4, h5 {
    margin: 0 0 10px;
    font-weight: 700;
    color: var(--text);
}

h2 {
    margin-top: 6px;
    letter-spacing: 0.2px;
}

p {
    margin: 0 0 10px;
    color: var(--text);
}

.muted {
    color: var(--muted);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
    color: var(--text);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-soft);
}

.media-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    align-items: flex-start;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.media-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
}

.media-card-featured {
    grid-template-columns: 130px 1fr;
    background: linear-gradient(135deg, rgba(63, 169, 245, 0.06), rgba(32, 36, 44, 0.9));
    border: 1px solid rgba(77, 193, 255, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.media-card-compact {
    grid-template-columns: 110px 1fr;
    align-items: stretch;
}

.media-poster {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: block;
    background: #0d0f14;
    position: relative;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #1b1f27, #0f1115);
    color: var(--muted);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
}

.media-content {
    display: grid;
    gap: 6px;
}

.media-title {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.1px;
}

.media-title a {
    color: var(--text);
}

.media-title a:hover {
    color: var(--accent-strong);
}

.media-meta {
    color: var(--muted);
    font-size: 14px;
}

.media-rating {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.media-description {
    margin: 2px 0 6px;
    color: var(--text);
}

.media-description.clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
}

.pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.card-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    align-items: start;
}

.card-row h3 {
    margin: 0;
}

.card-meta {
    color: var(--muted);
    font-size: 14px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.button, input[type=submit], button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover, input[type=submit]:hover, button:hover, .btn:hover {
    background: var(--surface-3);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.button.primary, input[type=submit], .btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0c0f;
}

.button.primary:hover, input[type=submit]:hover, .btn.primary:hover {
    background: var(--accent-strong);
}

.button.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.button.ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

form label {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 600;
}

input[type=text], input[type=password], textarea, select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

textarea {
    min-height: 120px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th, .table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.table th {
    background: var(--surface-2);
    text-align: left;
    color: var(--muted);
    letter-spacing: 0.2px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.alert-error {
    border-color: rgba(226, 92, 92, 0.4);
    background: rgba(226, 92, 92, 0.08);
    color: #ffcfcf;
}

.alert-success {
    border-color: rgba(86, 207, 139, 0.4);
    background: rgba(86, 207, 139, 0.08);
    color: #c9ffd8;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    padding: 6px 10px;
    border-radius: 999px;
    margin-right: 6px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
}

.tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero img {
    max-width: 200px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-details p {
    margin: 4px 0;
}

.fanedit-tabs {
    margin-top: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.tab-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tab-button {
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
    border-top: 3px solid transparent;
    height: 38px;
    padding: 0 12px;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
}

/* ACTIVE should look the SAME as others */
.tab-button.active {
    background: var(--surface-2) !important;
    color: var(--muted) !important;
    border-color: var(--border) !important;
    box-shadow: none !important;
}

.tab-panel {
    display: none;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.tab-panel.active {
    display: block;
}

.tab-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}

.tab-label {
    width: 200px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.tab-value {
    flex: 1;
    color: var(--text);
}

.info-list {
    margin: 0;
    padding-left: 18px;
}

.info-list li {
    margin: 4px 0;
}

.link-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.link-pill {
    background: var(--surface-2);
    padding: 8px 12px;
    border: 1px solid var(--border);
    color: var(--accent);
    border-radius: 999px;
    font-weight: 600;
}

.video-area {
    display: flex;
    justify-content: center;
}

.video-embed {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: #0f0f0f;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

@supports not (aspect-ratio: 16 / 9) {
    .video-embed {
        height: 0;
        padding-top: 56.25%;
    }
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 18px;
    margin: 0 auto;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.reviews-header {
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 4px;
}

.tab-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 6px 0 12px;
}

.rating-summary {
    margin: 0 0 12px;
    font-weight: 700;
}

.coverart-main {
    display: flex;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.coverart-main img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.coverart-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.coverart-thumb {
    width: 140px;
    text-align: center;
}

.coverart-thumb img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.coverart-thumb-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.review {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}

.review-title {
    font-weight: 700;
}

.review-form label {
    display: block;
    margin-top: 10px;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 16px;
}

.review-summary-block {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 12px;
    margin: 8px 0 16px;
    border-radius: 10px;
}

.review-summary-count {
    font-weight: 700;
    margin-bottom: 10px;
}

.review-summary-rows {
    display: grid;
    gap: 8px;
}

/* ============================================================
   TOP SUMMARY ("3 reviews"): stars closer to the numbers
   label | stars | score  (stars right-align near score)
   ============================================================ */
.summary-row {
    display: grid;
    grid-template-columns: 1fr 220px 62px;
    gap: 8px 6px;          /* tighter gap so stars sit closer to numbers */
    align-items: center;
}

.summary-label {
    color: var(--muted);
    font-weight: 600;
}

.summary-stars {
    justify-self: end !important;
    display: flex;
    justify-content: flex-end;
}

.summary-score {
    justify-self: end !important;
    width: 62px;
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

.star-display {
    position: relative;
    display: inline-block;
    font-size: 18px;
    color: #404855;
    line-height: 1;
}

.star-input-bar {
    --star-size: 20px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    font-size: var(--star-size);
    color: #404855;
    line-height: 1;
    cursor: pointer;
    padding: 6px 6px;
    --star-fill: 0%;
    width: max-content;
    max-width: none;
    min-height: 44px;
    letter-spacing: 0;
    white-space: nowrap;
}

.star-input-track {
    position: relative;
    display: inline-block;
}

.star-input-bar--readonly {
    cursor: default;
    pointer-events: none;
}

.star-input-bar .star-display-bg,
.star-input-bar .star-display-fill {
    font-size: 1em;
    line-height: 1;
}

.star-display-bg {
    color: #404855;
}

.star-display-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--star-fill, 0%);
    overflow: hidden;
    color: #f6c344;
    white-space: nowrap;
}

.star-display.no-rating {
    color: #404855;
}

.star-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
    align-items: flex-start;
}

.star-input-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 0;
}

.star-input-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    width: 100%;
}

.star-input-label {
    font-weight: 700;
    color: var(--text);
}

.star-input-bar .star-display-bg,
.star-input-bar .star-display-fill {
    pointer-events: none;
}

.star-current-value {
    font-size: 12px;
    color: var(--muted);
}

.star-value-input {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.star-value-input input {
    width: 70px;
    padding: 6px 8px;
    font-size: 13px;
}

.star-input-help {
    font-size: 12px;
    color: var(--muted);
}

.rating-grid .star-input-row {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 10px;
    height: 100%;
}

.review-card {
    border-top: 1px solid var(--border);
    padding: 12px 0;
    position: relative;
}

/* ============================================================
   ACTUAL REVIEW ROW:
   - Keep review text LEFT
   - Make ratings panel wide enough so SCORES stay INSIDE
   ============================================================ */
.review-card-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 420px; /* slightly wider */
    gap: 16px;
    align-items: start;
}

/* Prevent any grid child from forcing weird centering/overflow */
.review-card-grid > * {
    min-width: 0;
}

/* Ensure the middle column content is left-aligned */
.review-title-line,
.review-text,
.review-meta-line {
    text-align: left;
}

.review-left {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
}

.reviewer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reviewer-name {
    font-weight: 700;
}

.reviewer-badge {
    font-size: 12px;
    color: var(--accent);
}

/* Date chip */
.review-date {
    position: absolute;
    right: 8px;
    top: 10px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
    border-color: transparent;
    box-shadow: none;
}

.review-title-line {
    font-weight: 700;
    margin-bottom: 6px;
}

.review-text {
    line-height: 1.5;
    white-space: pre-line;
}

.review-meta-line {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    flex-wrap: wrap;
}

/* Right ratings panel wider + internal layout guarantees score stays inside */
.review-ratings {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;

    /* more right padding so the score never kisses the border */
    padding: 28px 18px 12px; /* top | LR | bottom */

    min-width: 380px;
    width: 100%;              /* fill the 420px column */
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;         /* hard stop: nothing can render outside */
}

/* label | stars | score */
.review-rating-row {
    display: grid;

    /* tighter label so the score has room */
    grid-template-columns: 150px 1fr 56px;

    align-items: center;
    gap: 6px 12px;
}

.rating-label {
    color: var(--muted);
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-score {
    font-weight: 700;
    font-size: 13px;

    justify-self: end;
    width: 56px;
    text-align: right;

    /* tiny safety padding */
    padding-right: 2px;
}

/* Stars never push the score out */
.review-rating-row .star-input-bar,
.review-rating-row .star-display,
.review-rating-row .star-input-track {
    justify-self: start;
    text-align: left;
    min-width: 0;
}

.review-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
}

.vote-actions {
    display: flex;
    gap: 6px;
}

.vote-button {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.vote-button.active {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.vote-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.owner-reply {
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
}

.owner-reply-header {
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.owner-reply-body {
    margin-top: 6px;
    line-height: 1.4;
}

.reply-form {
    margin-top: 10px;
}

.reply-form textarea {
    width: 100%;
}

/* Home page row styling */
.fanedit-listing {
    display: grid;
    gap: 12px;
}

.media-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.browse-toolbar {
    display: grid;
    gap: 12px;
}

.toolbar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-group label {
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-self: end;
    flex-wrap: wrap;
}

.toolbar-summary {
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 0.2px;
}

.poster-grid {
    --tile-min: 120px;
    --tile-ideal: 150px;
    --tile-max: 190px;
    --tile-w: clamp(var(--tile-min), 12vw, var(--tile-max));
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), var(--tile-w)));
    gap: 12px;
    justify-content: start;
}

.poster-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    width: var(--tile-w);
    max-width: var(--tile-w);
}

.poster-tile:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.45);
}

.poster-tile-image {
    position: relative;
    background: #0d0f14;
    border-bottom: 1px solid var(--border);
    aspect-ratio: 2 / 3;
    overflow: hidden;
}

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

.poster-fallback-tile {
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--muted);
    width: 100%;
    height: 100%;
}

.poster-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.poster-rating-chip {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(63, 169, 245, 0.9);
    color: #0b0c0f;
    border-radius: 12px;
    padding: 6px 10px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.poster-meta {
    padding: 0 12px 14px;
    display: grid;
    gap: 6px;
}

.poster-title {
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
}

.poster-sub {
    color: var(--muted);
    font-size: 13px;
}

.poster-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.poster-tag {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.1px;
}

.pagination-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-meta {
    color: var(--muted);
}

.card-row .meta-line {
    color: var(--muted);
}

.card-row .rating-line {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.card-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

@media (max-width: 980px) {
    .topbar {
        grid-template-columns: auto 1fr auto;
    }

    .content-area {
        padding: 18px;
    }
}

@media (max-width: 720px) {
    .topbar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .review-card-grid {
        grid-template-columns: 1fr; /* stack */
    }

    .review-date {
        position: static;
        text-align: right;
        margin-bottom: 8px;
    }

    .review-ratings {
        min-width: 0;
        width: 100%;
        padding-top: 12px;
        overflow: visible;
    }

    .tab-row {
        flex-direction: column;
    }

    .tab-label {
        width: auto;
    }
}

@media (max-width: 600px) {
    .star-input-bar {
        --star-size: 18px;
        padding: 6px 0;
        min-height: 40px;
        max-width: 220px;
    }

    .summary-row {
        grid-template-columns: 1fr 200px 60px;
    }

    .review-rating-row {
        grid-template-columns: 130px 1fr 56px;
    }
}

/* keep hover blue for tabs */
.tab-button:hover,
.tab-button:focus-visible {
    border-color: rgba(63, 169, 245, 0.55);
    color: var(--text);
}
