/**
 * Item page (edit-advanced of the six modules), Cinema layout (docs/revamp/). Hero with the external ratings, overview,
 * "your library" form, the extras tabs with the Media and Details tabs and related titles. Builds on components/media-kit.css (page layout,
 * section heads, rails, score display) and uses only the semantic tokens of layout-site/master.css.
 * Markup: resources/views/components/item-page/*. Behavior: public/js/components/item-page.js.
 */

/* ================== HERO ================== */
.item-hero {
    position: relative;
    overflow: hidden;
    padding-block: 36px 60px;
    background: var(--surface-0);
}

.item-hero-backdrop {
    position: absolute;
    top: -90px;
    left: -80px;
    width: calc(100% + 160px);
    height: calc(100% + 180px);
    object-fit: cover;
    object-position: 50% 22%;
    filter: blur(44px) brightness(0.52) saturate(1.15);
}

.item-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-0) 76%, transparent) 0%, color-mix(in srgb, var(--surface-0) 24%, transparent) 22%, transparent 40%),
        linear-gradient(0deg, var(--surface-0) 0%, color-mix(in srgb, var(--surface-0) 62%, transparent) 18%, transparent 48%),
        linear-gradient(90deg,
            color-mix(in srgb, var(--surface-0) 78%, transparent) 0%,
            color-mix(in srgb, var(--surface-0) 55%, transparent) 30%,
            color-mix(in srgb, var(--surface-0) 36%, transparent) 56%,
            color-mix(in srgb, var(--surface-0) 50%, transparent) 76%,
            color-mix(in srgb, var(--surface-0) 74%, transparent) 100%);
}

.item-hero-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.item-back {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    color: var(--text-1);
    text-decoration: none;
}

.item-back:hover {
    color: var(--accent);
}

.item-hero-main {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "cover body score";
    align-items: center;
    column-gap: 48px;
    margin-top: 24px;
}

.item-hero-cover {
    grid-area: cover;
    width: 256px;
    border-radius: 8px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(242, 239, 233, 0.14);
}

.item-hero-body {
    grid-area: body;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.item-hero-score {
    grid-area: score;
    align-self: center;
}

/* The tight line-height with the line clamp cut the accents of capitals ("AMANHÃ", "POKÉMON"): the padding gives
   them room and the margin takes it back, so the title stays where it was */
.item-hero-title {
    margin: calc(12px - 0.14em) 0 0;
    padding-top: 0.14em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: clamp(56px, 7.2vw, 104px);
    line-height: 0.92;
    letter-spacing: 0.005em;
    overflow-wrap: anywhere;
    color: var(--text-1);
}

.item-hero.is-long .item-hero-title {
    font-size: clamp(44px, 5vw, 72px);
}

.item-hero-subtitle {
    margin: 8px 0 0;
    font-size: 22px;
    font-weight: 500;
    line-height: 28px;
    color: var(--text-2);
}

.item-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 18px 0 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 22px;
    color: var(--text-1);
}

.item-hero-meta > span + span:not(.item-hero-type)::before {
    content: "\00b7";
    margin-right: 10px;
    color: var(--text-2);
}

.item-hero-type {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border: 1px solid color-mix(in srgb, var(--text-1) 50%, transparent);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.item-hero-type + span::before {
    display: none;
}

.item-hero-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

.item-hero-status-label {
    margin-right: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-2);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px 0 10px;
    border: 1px solid color-mix(in srgb, var(--pill-color, var(--text-2)) 55%, transparent);
    border-radius: 15px;
    background: color-mix(in srgb, var(--pill-color, var(--text-2)) 16%, transparent);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    color: var(--text-1);
}

.status-pill-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pill-color, var(--text-2));
}

.status-pill--score {
    --pill-color: var(--accent);
    font-weight: 500;
}

.status-pill--score i {
    font-size: 12px;
    color: var(--accent);
}

/* The user's own masterpiece (11): gold, with the crown and its name */
.status-pill--score.is-masterpiece {
    --pill-color: var(--masterpiece);
}

.status-pill--score.is-masterpiece i,
.status-pill--score.is-masterpiece .status-pill-number,
.status-pill-tag {
    color: var(--masterpiece);
}

.status-pill-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-pill-number {
    padding-top: 2px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 20px;
    line-height: 20px;
    letter-spacing: 0.02em;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 24px 0 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    color: var(--on-accent);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-hero:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
}

.btn-hero--ghost {
    padding: 0 22px 0 18px;
    border: 1px solid color-mix(in srgb, var(--text-1) 38%, transparent);
    background: color-mix(in srgb, var(--text-1) 8%, transparent);
    font-weight: 600;
    color: var(--text-1);
}

.btn-hero--ghost:hover {
    border-color: var(--text-1);
    background: color-mix(in srgb, var(--text-1) 14%, transparent);
    color: var(--text-1);
}

.btn-hero:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ================== EXTERNAL RATINGS (components/item-page/external-ratings) ================== */
/* Ratings from other sites under the community score (M-017): small chips with the site's name in small caps, the
   rating in the display face and the votes in the secondary color; never the accent, which stays with the THIRA
   score. The line with the scale of the site shows under the row for the chip with the pointer, the focus or a first
   tap; it is placed against .external-ratings, so the scrolling row of the phones never cuts it. */
.item-hero-score {
    min-width: 0;
}

.external-ratings {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 100%;
    margin-top: 22px;
}

/* Nothing to show and nothing on its way: the row does not show */
.external-ratings:not([aria-busy="true"]):not(:has(.rating-chip:not(.rating-chip--skeleton))) {
    display: none;
}

.external-ratings-label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-2);
}

.external-ratings-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 300px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.external-ratings-list > li {
    display: flex;
}

.rating-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 84px;
    padding: 8px 12px 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface-1) 78%, transparent);
    color: var(--text-1);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rating-chip:hover,
.rating-chip:focus-visible,
.rating-chip.is-previewed {
    border-color: var(--text-2);
    background: var(--surface-2);
    color: var(--text-1);
}

.rating-chip:focus {
    outline: none;
}

.rating-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.rating-chip-source {
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-2);
}

.rating-chip-kind::before {
    content: "\00b7";
    margin: 0 4px;
}

.rating-chip-value {
    margin-top: 4px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 26px;
    line-height: 24px;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
}

.rating-chip-votes {
    margin-top: 3px;
    font-size: 11px;
    line-height: 14px;
    white-space: nowrap;
    color: var(--text-2);
}

/* The scale of the site: hidden until the chip has the pointer, the focus or a first tap */
.rating-chip-detail {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.rating-chip:hover .rating-chip-detail,
.rating-chip:focus-visible .rating-chip-detail,
.rating-chip.is-previewed .rating-chip-detail {
    top: 100%;
    right: 0;
    z-index: 3;
    width: max-content;
    max-width: 340px;
    height: auto;
    margin-top: 8px;
    padding: 6px 10px;
    overflow: visible;
    clip-path: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: normal;
    text-align: left;
    color: var(--text-1);
}

.rating-chip-open {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-2);
}

.rating-chip-open i {
    font-size: 10px;
}

.rating-chip--skeleton {
    width: 84px;
    height: 64px;
    border-color: transparent;
}

/* ================== OVERVIEW ================== */
.item-overview {
    display: grid;
    grid-template-columns: minmax(0, 736fr) minmax(0, 512fr);
    column-gap: 64px;
    row-gap: 40px;
    align-items: start;
    padding-top: 64px;
}

.item-block-title {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--text-1);
}

.item-synopsis {
    margin: 0;
    font-size: 18px;
    line-height: 30px;
    color: var(--text-1);
    white-space: pre-line;
}

.item-synopsis--empty {
    font-size: 15px;
    line-height: 22px;
    color: var(--text-2);
}

.genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.genre-chips li {
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 26px;
    color: var(--text-1);
}

.info-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.info-list > div {
    min-width: 0;
    padding: 14px 0 15px;
    border-top: 1px solid var(--line);
}

.info-list > .info-list-wide {
    grid-column: span 2;
}

.info-list dt {
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

.info-list dd {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    overflow-wrap: anywhere;
    color: var(--text-1);
}

.info-list .genre-chips {
    margin-top: 6px;
}

/* ================== GAME FEATURES (components/item-page/game-features) ================== */
/* Discreet chips in the secondary text color: the accent stays for what leads the page. The source of the chip
   that has the pointer or the focus shows in one line under the list, so it never spills out of the screen. */
.game-features {
    position: relative;
    padding-top: 40px;
}

.game-features-title {
    margin: 0 0 12px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

.game-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-feature {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 13px 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--surface-1);
    font-size: 13px;
    font-weight: 500;
    line-height: 30px;
    white-space: nowrap;
    color: var(--text-2);
    cursor: help;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.game-feature i {
    font-size: 12px;
}

.game-feature:hover,
.game-feature:focus {
    border-color: var(--text-2);
    color: var(--text-1);
}

.game-feature:focus {
    outline: none;
}

.game-feature:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.game-feature-source {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* A game nothing was known about fetches its features once when the page opens: skeleton chips meanwhile, and the
   row leaves when the fetch brings none */
.game-features:not([aria-busy="true"]):not(:has(.game-feature:not(.game-feature--skeleton))) {
    display: none;
}

.game-feature--skeleton {
    width: 96px;
    border-color: transparent;
    cursor: default;
}

.game-feature--skeleton:nth-child(2) {
    width: 128px;
}

.game-feature--skeleton:nth-child(3) {
    width: 84px;
}

.game-feature:hover .game-feature-source,
.game-feature:focus .game-feature-source {
    top: 100%;
    left: var(--page-inset);
    z-index: 2;
    width: auto;
    max-width: calc(100% - 2 * var(--page-inset));
    height: auto;
    margin-top: 10px;
    padding: 4px 10px;
    overflow: visible;
    clip-path: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    font-size: 12px;
    line-height: 18px;
    white-space: normal;
    color: var(--text-1);
}

/* ================== YOUR LIBRARY (entry form) ================== */
.entry-form {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 36px;
    margin: 0;
    padding: 32px 36px 28px;
    border-radius: var(--radius);
    background: var(--surface-1);
    box-shadow: inset 0 0 0 1px var(--line);
}

.entry-field {
    grid-column: span 12;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.entry-field--1-3 { grid-column: span 4; }
.entry-field--5 { grid-column: span 5; }
.entry-field--4 { grid-column: span 4; }
.entry-field--3 { grid-column: span 3; }
.entry-field--2 { grid-column: span 2; }
.entry-field--6 { grid-column: span 6; }
.entry-field--8 { grid-column: span 8; }

.entry-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 18px;
    margin: 0 0 12px;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    color: var(--text-1);
}

.entry-required {
    color: var(--danger);
}

/* "Edited" tag, shown by item-page.js while the field differs from the saved value */
.entry-edited {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.entry-edited::before {
    content: '';
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.entry-field.is-edited .entry-edited {
    display: inline-flex;
}

.entry-help {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 17px;
    color: var(--text-2);
}

.entry-error {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
}

.entry-input,
.entry-form .entry-input.form-control {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 20px;
    color: var(--text-1);
}

.entry-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.entry-input::placeholder {
    color: var(--text-2);
    opacity: 1;
}

textarea.entry-input {
    height: auto;
    min-height: 200px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 24px;
    resize: vertical;
}

.entry-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    font-size: 12px;
    line-height: 18px;
    color: var(--text-2);
}

.entry-counter {
    flex: none;
    font-variant-numeric: tabular-nums;
}

.entry-counter.is-near {
    color: var(--accent);
}

.entry-counter.is-over {
    font-weight: 700;
    color: var(--danger);
}

/* Situation: one card per situation, colored by the situation */
.situation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    border-radius: 10px;
    transition: box-shadow 0.2s ease;
}

.entry-field.is-invalid .situation-options {
    box-shadow: 0 0 0 2px var(--danger), 0 0 0 6px color-mix(in srgb, var(--danger) 18%, transparent);
}

.situation-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 56px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.situation-option:hover {
    border-color: var(--situation-color, var(--text-2));
}

.situation-option-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--situation-color, var(--text-2));
}

.situation-option-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-1);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.situation-option-check {
    display: none;
    font-size: 13px;
    color: var(--situation-color, var(--text-1));
}

.situation-option:has(input:checked) {
    padding: 0 14px 0 15px;
    border: 2px solid var(--situation-color, var(--accent));
    background: color-mix(in srgb, var(--situation-color, var(--accent)) 12%, transparent);
}

.situation-option:has(input:checked) .situation-option-name {
    font-weight: 700;
}

.situation-option:has(input:checked) .situation-option-check {
    display: block;
}

.situation-option:has(input:focus-visible),
.recommend-option:has(input:focus-visible),
.favorite-switch:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Score: 1..10 in one segmented bar */
.score-scale {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    height: 52px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    overflow: hidden;
}

.score-scale label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding-top: 3px;
    border-right: 1px solid var(--line);
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 22px;
    line-height: 22px;
    color: var(--text-2);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.score-scale label:last-of-type {
    border-right: 0;
}

.score-scale label:hover {
    background: var(--accent-soft);
    color: var(--text-1);
}

.score-scale label:has(input:checked) {
    background: var(--accent);
    font-size: 24px;
    color: var(--on-accent);
}

.score-scale label:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: -4px;
}

.score-scale label:has(input:checked:focus-visible) {
    outline-color: var(--on-accent);
}

.score-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.score-caption-text {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: var(--text-1);
}

.score-caption-text i {
    font-size: 12px;
    color: var(--accent);
}

.score-caption-text.is-empty {
    color: var(--text-2);
}

.score-caption-text.is-empty i {
    color: var(--text-2);
}

/* The masterpiece (11): gold, with a small crown over the number. Tokens in media-kit.css */
.score-scale label.is-masterpiece {
    flex-direction: column;
    gap: 3px;
    padding-top: 0;
    background: color-mix(in srgb, var(--masterpiece) 7%, var(--field-bg));
    color: var(--masterpiece);
}

.score-scale label.is-masterpiece i {
    font-size: 10px;
    line-height: 1;
}

.score-scale label.is-masterpiece:hover {
    background: color-mix(in srgb, var(--masterpiece) 18%, var(--field-bg));
    color: var(--masterpiece);
}

.score-scale label.is-masterpiece:has(input:checked) {
    background: var(--masterpiece-gradient);
    color: var(--on-masterpiece);
}

.score-scale label.is-masterpiece:has(input:focus-visible) {
    outline-color: var(--masterpiece);
}

.score-scale label.is-masterpiece:has(input:checked:focus-visible) {
    outline-color: var(--on-masterpiece);
}

.score-field.is-masterpiece .score-caption-text,
.score-field.is-masterpiece .score-caption-text i {
    color: var(--masterpiece);
}

/* "3 of 5 masterpieces", and the one that goes back to 10 once the swap dialog picked it */
.score-masterpieces {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 7px;
    row-gap: 4px;
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 17px;
    color: var(--text-2);
}

.score-masterpieces i {
    font-size: 10px;
    color: color-mix(in srgb, var(--masterpiece) 65%, var(--text-2));
}

.score-field.is-masterpiece .score-masterpieces i {
    color: var(--masterpiece);
}

.score-masterpieces-note {
    flex-basis: 100%;
    font-weight: 600;
    color: var(--masterpiece);
}

.link-button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    color: var(--text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--text-1);
}

.link-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Progress: current value, total and a bar */
.progress-entry {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

/* Five digits (the field's limit) plus the number spinner, in the digit width of the theme's font */
.progress-entry .entry-input {
    width: calc(5ch + 47px);
    padding: 4px 10px 0 16px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 30px;
    line-height: 30px;
    letter-spacing: 0.02em;
}

.progress-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
}

.progress-total-number {
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 30px;
    line-height: 30px;
    letter-spacing: 0.02em;
    color: var(--text-2);
}

.progress-total-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: var(--text-2);
}

.progress-bar-track {
    height: 4px;
    margin-top: 14px;
    border-radius: 2px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

/* Favorite: a switch row */
.favorite-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    margin: 0;
    padding: 0 12px 0 16px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    cursor: pointer;
}

.favorite-switch > i {
    font-size: 16px;
    color: var(--text-2);
    transition: color 0.15s ease;
}

.favorite-switch-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-1);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.favorite-switch-track {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    border: 1px solid var(--field-line);
    border-radius: 12px;
    background: var(--surface-3);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.favorite-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-2);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.favorite-switch:has(input:checked) {
    border-color: color-mix(in srgb, var(--danger) 55%, transparent);
}

.favorite-switch:has(input:checked) > i {
    color: var(--danger);
}

.favorite-switch:has(input:checked) .favorite-switch-track {
    border-color: var(--danger);
    background: var(--danger);
}

.favorite-switch:has(input:checked) .favorite-switch-track::after {
    background: #fff;
    transform: translateX(16px);
}

/* "Watched" (movies) uses the same switch in the success color */
.watched-switch:has(input:checked) {
    border-color: color-mix(in srgb, var(--success) 55%, transparent);
}

.watched-switch:has(input:checked) > i {
    color: var(--success);
}

.watched-switch:has(input:checked) .favorite-switch-track {
    border-color: var(--success);
    background: var(--success);
}

/* Recommendation: three stacked options */
.recommend-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommend-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.recommend-option i {
    width: 18px;
    font-size: 15px;
    text-align: center;
    color: var(--recommend-color);
}

.recommend-option span {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-1);
}

.recommend-option:hover {
    border-color: var(--recommend-color);
}

.recommend-option:has(input:checked) {
    padding: 0 15px;
    border: 2px solid var(--recommend-color);
    background: color-mix(in srgb, var(--recommend-color) 12%, transparent);
}

.recommend-option:has(input:checked) span {
    font-weight: 700;
}

.recommend-option--yes { --recommend-color: var(--success); }
.recommend-option--neutral { --recommend-color: var(--text-2); }
.recommend-option--no { --recommend-color: var(--danger); }

/* Progress per season (series): one card per season */
.season-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.season-head .entry-label {
    margin: 0;
}

.season-check-all,
.season-card-complete {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--text-1);
    cursor: pointer;
}

.season-check-all .form-check-input,
.season-card-complete .form-check-input {
    flex: none;
    margin: 0;
    cursor: pointer;
}

.entry-help.season-help {
    margin: 6px 0 16px;
}

.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.season-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    transition: border-color 0.15s ease;
}

.season-card.is-complete {
    border-color: color-mix(in srgb, var(--success) 55%, transparent);
}

.season-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.season-card-name {
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--text-1);
}

.season-card-airing {
    height: 20px;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    font-size: 10px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
}

.season-card-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.season-card-progress .entry-input {
    width: 80px;
    height: 44px;
    padding: 3px 10px 0 12px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 26px;
    line-height: 26px;
}

.season-card-progress .entry-input[readonly] {
    color: var(--success);
}

.season-card-total {
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 26px;
    line-height: 26px;
    color: var(--text-2);
}

.season-card-note {
    margin: 0;
    font-size: 12px;
    line-height: 17px;
    color: var(--text-2);
}

.season-card .progress-bar-track {
    margin-top: 0;
}

.season-card.is-complete .progress-bar-fill {
    background: var(--success);
}

.season-card-complete {
    font-size: 13px;
    font-weight: 500;
}

.serie-facts {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.serie-facts-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

.serie-facts ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.serie-facts li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-1);
}

.serie-facts li i {
    width: 16px;
    text-align: center;
    color: var(--text-2);
}

.serie-facts li.is-estimated {
    font-style: italic;
    color: var(--text-2);
}

/* Lists (Select2 multiple) in the field look */
.entry-form .select2-container--default .select2-selection--multiple {
    min-height: 52px;
    padding: 7px 36px 7px 8px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field-bg);
    cursor: text;
}

.entry-form .select2-container--default.select2-container--focus .select2-selection--multiple,
.entry-form .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.entry-form .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.entry-form .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    margin: 0;
    padding: 0 8px 0 11px;
    border: 0;
    border-radius: 6px;
    background: var(--surface-3);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

.entry-form .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2;
    margin: 0 0 0 2px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    font-size: 16px;
    color: var(--text-2);
}

.entry-form .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: transparent;
    color: var(--danger);
}

.entry-form .select2-container--default .select2-search--inline .select2-search__field {
    height: 36px;
    margin: 0;
    padding: 0 4px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-1);
}

.entry-form .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: var(--text-2);
}

/* The dropdown opens inside the field (dropdownParent in item-page.js) */
.entry-field .select2-dropdown {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-2);
    overflow: hidden;
    box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.8);
}

.entry-field .select2-container--default .select2-results__option {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-1);
}

.entry-field .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--accent-soft);
    color: var(--text-1);
}

.entry-field .select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--surface-3);
}

.entry-field .select2-container--default .select2-results__message {
    color: var(--text-2);
}

.list-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.list-choice-icon {
    color: var(--list-color, var(--text-2));
}

.list-choice-privacy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 2px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}

/* Actions: unlink on the left, unsaved status and save on the right */
.entry-actions {
    grid-column: span 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.btn-unlink {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin: 0;
    padding: 0 18px 0 14px;
    border: 1px solid color-mix(in srgb, var(--danger) 60%, transparent);
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--danger);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-unlink:hover {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.btn-unlink:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

.entry-actions-help {
    max-width: 320px;
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--text-2);
}

.entry-actions-end {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.unsaved-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    color: var(--text-1);
}

.unsaved-status::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.unsaved-status[hidden] {
    display: none;
}

.unsaved-status-fields {
    font-weight: 400;
    color: var(--text-2);
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
}

.btn-back-link:hover {
    color: var(--text-1);
}

/* Guests: prompt to log in instead of the form */
.entry-guest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding: 28px 32px;
    border-radius: var(--radius);
    background: var(--surface-1);
    box-shadow: inset 0 0 0 1px var(--line);
}

.entry-guest i {
    font-size: 22px;
    color: var(--accent);
}

.entry-guest p {
    flex: 1;
    min-width: 220px;
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    color: var(--text-1);
}

/* ================== RELATED ================== */
.item-related-rail {
    --cover-w: clamp(140px, 13.4vw, 192px);
    --rail-arrow-y: calc(var(--cover-w) * 0.75 + 4px);
}

/* ================== COMMUNITY (components/item-page/community) ================== */
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    align-items: start;
    gap: 20px;
}

.community-card {
    min-width: 0;
    padding: 22px 24px 24px;
    border-radius: var(--radius);
    background: var(--surface-1);
    box-shadow: inset 0 0 0 1px var(--line);
}

.community-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 24px;
    color: var(--text-1);
}

.community-card-sub {
    margin: 4px 0 0;
    font-size: 13.5px;
    line-height: 19px;
    color: var(--text-2);
}

/* People per situation: one bar split by situation, the counts below */
.community-bar {
    display: flex;
    gap: 3px;
    height: 10px;
    margin: 18px 0 16px;
    overflow: hidden;
    border-radius: 5px;
    background: var(--surface-3);
}

.community-bar > span {
    flex: 0 0 var(--share);
    min-width: 6px;
    background: var(--situation-color);
}

.community-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-1);
}

.community-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.community-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--situation-color);
}

/* Score per platform of a game */
.community-platforms,
.community-friend-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.community-platform {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.community-platform:first-child {
    border-top: 0;
}

.community-platform-name {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-1);
}

.community-platform-score {
    grid-row: span 2;
    align-self: center;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 26px;
    line-height: 1;
    color: var(--text-1);
}

.community-platform-score i {
    align-self: center;
    font-size: 14px;
    color: var(--accent);
}

.community-platform-max {
    font-size: 15px;
    color: var(--text-2);
}

.community-platform-count {
    font-size: 12.5px;
    color: var(--text-2);
}

.community-platform.is-masterpiece .community-platform-score,
.community-platform.is-masterpiece .community-platform-score i {
    color: var(--masterpiece);
}

/* Friends who have the title */
.community-friend-list {
    max-height: 340px;
    overflow-y: auto;
}

.community-friend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.community-friend:first-child {
    border-top: 0;
}

.community-friend-who {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text-1);
    text-decoration: none;
}

.community-friend-who:hover .community-friend-name {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.community-friend-who:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.community-friend-avatar {
    --avatar-size: 34px;
    flex: none;
}

.community-friend-name {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-friend-tags {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.community-friend-situation {
    height: 26px;
    padding: 0 10px 0 8px;
    font-size: 12px;
}

.community-friend-score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-top: 2px;
    font-family: var(--font-display);
    font-weight: var(--font-display-weight);
    font-size: 20px;
    line-height: 1;
    color: var(--text-1);
}

.community-friend-score i {
    margin-top: -2px;
    font-size: 12px;
    color: var(--accent);
}

.community-friend-score.is-masterpiece,
.community-friend-score.is-masterpiece i {
    color: var(--masterpiece);
}

.community-friend-flag {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    font-size: 12px;
}

.community-friend-flag.is-yes {
    color: var(--success);
}

.community-friend-flag.is-no {
    color: var(--danger);
}

.community-friend-flag.is-favorite {
    color: var(--danger);
}

.community-empty {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--text-2);
}

.community-card-foot {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.community-card-foot a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    text-decoration: none;
}

.community-card-foot a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.community-card-foot a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ================== EXTRAS (components/item-page/extras-tabs) ================== */
/* Kit tabs (.kit-tabs) over the panels: "Mídia" and, on the game, its own tabs */
.item-extras-content {
    min-height: 120px;
}

/* Screenshots and scenes: thumbnails that open the lightbox (components/media-kit/lightbox) */
.extras-shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.extras-shot {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: zoom-in;
}

.extras-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.extras-shot:hover img {
    transform: scale(1.04);
}

.extras-shot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(242, 239, 233, 0.07);
    pointer-events: none;
}

.extras-shot:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ================== MEDIA TAB (components/item-page/media, js/components/video-facade.js) ================== */
.item-media {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* The main video, 16:9 across the tab but never taller than the screen. The facade (a thumbnail with the play
   button) turns into the youtube-nocookie player on click. */
.item-media-player {
    position: relative;
    width: min(100%, calc((100vh - 140px) * 16 / 9));
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.item-media-facade {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
    color: #f2efe9;
    cursor: pointer;
}

.item-media-facade img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.item-media-facade::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(11, 11, 14, 0.9) 100%);
    pointer-events: none;
}

.item-media-facade:hover img {
    transform: scale(1.02);
    filter: brightness(1.08);
}

.item-media-facade:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

.item-media-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border-radius: 50%;
    background: var(--accent);
    font-size: 26px;
    color: var(--on-accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* The triangle looks centered a little to the right */
.item-media-play i {
    margin-left: 4px;
}

.item-media-facade:hover .item-media-play,
.item-media-facade:focus-visible .item-media-play {
    transform: scale(1.08);
    background: var(--accent-hover);
}

.item-media-caption {
    position: absolute;
    right: 28px;
    bottom: 22px;
    left: 28px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
}

.item-media-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(242, 239, 233, 0.82);
}

.item-media-name {
    display: -webkit-box;
    max-width: 760px;
    overflow: hidden;
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Language of a TMDb video (PT, EN) */
.item-media-lang {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border: 1px solid rgba(242, 239, 233, 0.4);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
}

.item-media-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* While the fetch on open looks for the trailer */
.item-media-skeleton {
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.item-media-skeleton-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-2);
}

.item-media-skeleton-shot {
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
}

.item-media-heading {
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
}

/* The videos as a kit rail inside the tab: no page gutter, arrows at the middle of the thumbnails */
.item-media-rail {
    --rail-inset: 0px;
    --rail-gap: 16px;
    --rail-arrow-y: 66px;
}

/* Without a gutter the arrow would sit on the first thumbnail: it shows once there is something back there */
.item-media-rail .media-rail-arrow--prev:disabled {
    opacity: 0;
    pointer-events: none;
}

.item-media-videos {
    margin: 0;
    list-style: none;
}

.item-media-video {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 220px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    color: var(--text-1);
    cursor: pointer;
}

.item-media-video-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-2);
}

.item-media-video-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Drawn over the image, so the current video's accent border shows */
.item-media-video-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(242, 239, 233, 0.08);
    pointer-events: none;
}

.item-media-video:hover .item-media-video-thumb img {
    transform: scale(1.04);
}

.item-media-video.is-current .item-media-video-thumb::after {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.item-media-video:focus-visible {
    outline: none;
}

.item-media-video:focus-visible .item-media-video-thumb::after {
    box-shadow: inset 0 0 0 3px var(--accent);
}

.item-media-video-play {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(11, 11, 14, 0.74);
    font-size: 11px;
    color: #f2efe9;
}

.item-media-video.is-current .item-media-video-play {
    background: var(--accent);
    color: var(--on-accent);
}

.item-media-video-type {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
}

.item-media-video-type .item-media-lang {
    height: 16px;
    padding: 0 5px;
    border-color: var(--line-strong);
}

.item-media-video-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 18px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ================== DETAILS TAB (components/item-page/game-details) ================== */
/* Blocks side by side while they fit: additional content, editions and versions, languages, credits */
.game-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 40px 56px;
    align-items: start;
}

.game-details-grid + .game-details-grid {
    margin-top: 40px;
}

.game-details-block {
    min-width: 0;
}

.game-details-games {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.game-details-games > li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.game-details-games > li[hidden],
.game-details-languages tr[hidden] {
    display: none;
}

.game-details-game {
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 21px;
    overflow-wrap: anywhere;
    color: var(--text-1);
}

/* The games the catalog has open their THIRA page: a muted underline tells them apart from the others */
a.game-details-game {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--text-2) 55%, transparent);
    text-underline-offset: 4px;
}

a.game-details-game:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}

a.game-details-game:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.game-details-tag {
    flex: none;
    height: 22px;
    padding: 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-2);
}

.game-details-languages {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 20px;
}

.game-details-languages th,
.game-details-languages td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.game-details-languages thead th {
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-top: 1px solid var(--line);
    color: var(--text-2);
}

.game-details-languages th:first-child {
    padding-left: 0;
    text-align: left;
}

.game-details-languages tbody th {
    font-weight: 600;
    color: var(--text-1);
}

.game-details-languages td i {
    font-size: 13px;
    color: var(--text-1);
}

.game-details-without {
    color: var(--text-2);
}

.game-details-credits {
    margin-top: 0;
}

.extras-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    text-decoration: none;
}

.extras-more i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.extras-more[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.game-details-skeleton-title {
    display: block;
    width: 40%;
    height: 14px;
    margin-bottom: 18px;
    border-radius: 4px;
}

.game-details-skeleton-row {
    display: block;
    height: 36px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

/* ================== RESPONSIVE ================== */
@media (max-width: 1199.98px) {
    .item-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .entry-field--5,
    .entry-field--4,
    .entry-field--3 {
        grid-column: span 6;
    }

    .entry-field--5 {
        grid-column: span 12;
    }

    .entry-field--2 {
        grid-column: span 4;
    }

    .entry-field--6,
    .entry-field--8,
    .entry-field--1-3 {
        grid-column: span 12;
    }

}

@media (max-width: 991.98px) {
    .item-hero-main {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "cover score"
            "body  body";
        column-gap: 24px;
        row-gap: 24px;
    }

    .item-hero-cover {
        width: 180px;
    }

    /* Next to the cover the score is left aligned: the chips follow it in one row that scrolls sideways */
    .external-ratings {
        align-items: flex-start;
        margin-top: 18px;
    }

    .external-ratings-list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .external-ratings-list::-webkit-scrollbar {
        display: none;
    }

    .external-ratings-list > li {
        flex: none;
    }

    .rating-chip:hover .rating-chip-detail,
    .rating-chip:focus-visible .rating-chip-detail,
    .rating-chip.is-previewed .rating-chip-detail {
        right: 0;
        left: 0;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .item-hero {
        padding-block: 20px 36px;
    }

    .item-hero .page-breadcrumb-nav {
        display: none;
    }

    .item-hero-cover {
        width: 128px;
    }

    .item-hero-title {
        font-size: 52px;
    }

    .item-hero.is-long .item-hero-title {
        font-size: 40px;
    }

    .item-hero-subtitle {
        font-size: 17px;
        line-height: 24px;
    }

    .item-overview {
        padding-top: 40px;
    }

    .item-synopsis {
        font-size: 16px;
        line-height: 26px;
    }

    .entry-form {
        column-gap: 12px;
        row-gap: 28px;
        margin-inline: calc(var(--page-inset) * -1 + 8px);
        padding: 22px 16px;
    }

    .entry-field--2,
    .entry-field--3,
    .entry-field--4 {
        grid-column: span 12;
    }

    .situation-options {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }

    .score-scale label {
        font-size: 19px;
    }

    .entry-actions-help {
        display: none;
    }

    .entry-actions-end {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    /* Two thumbnails a row: one a row turned six scenes into a long scroll */
    .extras-shots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* One row of image placeholders is enough */
    .extras-shots[data-extras-pending] li:nth-child(n + 3) {
        display: none;
    }

    .item-media {
        gap: 32px;
    }

    .item-media-player {
        width: 100%;
        border-radius: 10px;
    }

    .item-media-play {
        width: 58px;
        height: 58px;
        margin: -29px 0 0 -29px;
        font-size: 20px;
    }

    .item-media-caption {
        right: 14px;
        bottom: 12px;
        left: 14px;
        gap: 3px;
    }

    .item-media-type {
        font-size: 11px;
    }

    .item-media-name {
        font-size: 15px;
        line-height: 20px;
        -webkit-line-clamp: 1;
    }

    .item-media-rail {
        --rail-gap: 12px;
        --rail-arrow-y: 51px;
    }

    .item-media-video {
        width: 168px;
    }

    .game-details-grid {
        gap: 32px;
    }

    .game-details-languages {
        font-size: 13px;
    }

    .game-details-languages th,
    .game-details-languages td {
        padding: 9px 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .progress-bar-fill,
    .favorite-switch-track,
    .favorite-switch-track::after,
    .extras-shot img,
    .item-media-facade img,
    .item-media-play,
    .item-media-video-thumb img,
    .rating-chip,
    .extras-more i {
        transition: none;
    }
}
