/* ==========================================================================
   ETERNAL VOID - PRESET RATINGS (js/preset-ratings.js)
   Thumbs up / down beside the preset name in the HUD, a liked/disliked mark in
   the Presets list, and Export / Copy in the Presets tab.
   Contrast: the HUD glass is only 40% dark, so over a bright scene it can be
   light. The rating buttons carry their own near-opaque backing (worst case,
   pure white behind: about rgb(43, 44, 50)), which keeps the icons above 7:1.
   The list mark and the Export row sit on the 75% dark control panel (worst
   case about rgb(70, 70, 73)): every colour here stays at or above 4.5:1 there.
   ========================================================================== */

.hud-rating {
    display: inline-flex;
    gap: 4px;
    margin-right: 4px;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
}

/* When the HUD card is narrow (phones, TV) the preset row's buttons take a
   line of their own under the name instead of squeezing it or spilling out.
   On a wide screen everything still fits on one line. */
.hud-current-state > .hud-state-row:first-child {
    flex-wrap: wrap;
    gap: 6px;
}
.hud-current-state > .hud-state-row:first-child .hud-state-actions {
    align-items: center;
    margin-left: auto;
}

.hud-icon-btn.hud-rate-btn {
    background: rgba(6, 8, 14, 0.85);
    border-color: rgba(226, 232, 240, 0.32);
    color: #e2e8f0;
}
.hud-icon-btn.hud-rate-btn:hover:not(:disabled) {
    background: rgba(30, 36, 52, 0.92);
    color: #ffffff;
}
.hud-icon-btn.hud-rate-btn:focus-visible {
    outline: 2px solid #a5f3fc;
    outline-offset: 2px;
}
/* Disabled until a preset is loaded (nothing to rate during free Flow). */
.hud-icon-btn.hud-rate-btn:disabled {
    opacity: 0.45;
    cursor: default;
}
#hud-rate-up.is-rated {
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.7);
    box-shadow: 0 0 8px rgba(134, 239, 172, 0.25);
}
#hud-rate-up.is-rated svg { fill: rgba(134, 239, 172, 0.35); }
#hud-rate-down.is-rated {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.7);
    box-shadow: 0 0 8px rgba(252, 165, 165, 0.25);
}
#hud-rate-down.is-rated svg { fill: rgba(252, 165, 165, 0.35); }

/* Mark in the Presets list: icon plus screen-reader text and a title. */
.preset-rating-mark {
    display: inline-flex;
    flex: none;
    align-items: center;
}
.preset-rating-mark[hidden] { display: none; }
.preset-rating-mark svg { width: 12px; height: 12px; }
.preset-rating-mark.is-liked { color: #86efac; }
.preset-rating-mark.is-disliked { color: #fca5a5; }
.preset-rating-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Export / Copy under the Presets list. */
.preset-ratings-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 10px;
}
.preset-ratings-summary {
    flex: 1 1 160px;
    color: #cbd5e1;
    font-size: 10px;
    line-height: 1.4;
}
.preset-ratings-tools .btn-text {
    color: #c7d2fe;
    min-height: 28px;
    padding: 4px 6px;
}
.preset-ratings-tools .btn-text:focus-visible {
    outline: 2px solid #a5f3fc;
    outline-offset: 1px;
    border-radius: 4px;
}

@media (pointer: coarse) {
    .hud-icon-btn.hud-rate-btn { width: 36px; height: 36px; }
    .hud-icon-btn.hud-rate-btn svg { width: 18px; height: 18px; }
    .preset-ratings-tools .btn-text { min-height: 44px; padding: 0 10px; }
}

/* TV: big enough to read and hit from the couch; the D-pad reaches them
   because they are real buttons (js/device-mode.js skips disabled ones). */
[data-device="tv"] .hud-icon-btn.hud-rate-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
}
[data-device="tv"] .hud-icon-btn.hud-rate-btn svg {
    width: 22px;
    height: 22px;
}
[data-device="tv"] .hud-rating {
    gap: 10px;
    margin-right: 6px;
    padding-right: 10px;
}
[data-device="tv"] .preset-rating-mark svg {
    width: 16px;
    height: 16px;
}
[data-device="tv"] .preset-ratings-tools .btn-text {
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
}
[data-device="tv"] .preset-ratings-summary {
    font-size: 13px;
}
