/* Going Mary for Samsung TV. Laid out at 1920x1080 CSS px: Android dp x 2.
   Colours are the Android tokens from ui/Components.kt. */
:root {
  --accent: #c7ccd6;
  --silver: #a8adb8;
  --muted: #8c8c8c;
  --surface: #1c1c1c;
  --chip: #4d4d4d;
  --page: #000;
  --page-start: 184px; /* Metrics.pageStart 92.dp */
  --page-end: 72px; /* Metrics.pageEnd 36.dp */
  --poster-w: 220px; /* Metrics.posterWidth 110.dp */
  --poster-h: 330px; /* Metrics.posterHeight 165.dp */
  --poster-gap: 36px; /* Metrics.posterGap 18.dp */
  --poster-radius: 20px;
  --row-radius: 24px;
  --field-radius: 24px;
  --focus-scale: 1.1;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: var(--page);
  color: #fff;
  font-family: "SamsungOne", "Samsung Sharp Sans", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 28px; /* 14.sp */
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: default;
}
#root { position: relative; width: 1920px; height: 1080px; overflow: hidden; }
img { display: block; }
button { font: inherit; color: inherit; }
[data-f] { outline: none; }

/* Scrolling containers (see ui/focus.tsx). Transforms, never native scroll. */
.gm-row { position: relative; overflow: hidden; width: 100%; }
.gm-row-track { display: flex; flex-direction: row; align-items: flex-start; width: max-content; min-width: 100%; transition: transform 240ms var(--ease); will-change: transform; padding-top: 24px; padding-bottom: 32px; }
.gm-page { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
.gm-page-track { position: relative; transition: transform 260ms var(--ease); will-change: transform; }

/* Text helpers */
.muted { color: var(--muted); }
.silver { color: var(--silver); }
.clamp1, .clamp2, .clamp3, .clamp4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { -webkit-line-clamp: 1; }
.clamp2 { -webkit-line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; }
.clamp4 { -webkit-line-clamp: 4; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Reduce motion of image pop-in */
.fade-in { animation: gm-fade 300ms ease-out both; }
@keyframes gm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gm-spin { to { transform: rotate(360deg); } }
@keyframes gm-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.8; } }

/* ---------------------------------------------------------------- Components.tsx */

/* PillButton: capsule; focus = white with dark text, scale 1.06 */
.gm-pill { display: inline-flex; flex-direction: row; align-items: center; padding: 18px 36px; border-radius: 999px; background: rgba(77,77,77,0.55); color: #fff; font-size: 30px; font-weight: 500; white-space: nowrap; transition: transform 150ms var(--ease), background-color 150ms; flex: none; }
.gm-pill svg { margin-right: 16px; }
.gm-pill.primary { background: rgba(255,255,255,0.92); color: #000; font-weight: 600; }
.gm-pill.selected { background: var(--accent); color: #000; font-weight: 600; }
.gm-pill.focused { background: #fff; color: #000; font-weight: 600; transform: scale(1.06); }
.gm-pill[data-disabled="true"] { opacity: 0.4; }

/* ListRow: full-width row; focus = white with dark text, scale 1.015 */
.gm-listrow { display: flex; flex-direction: row; align-items: center; width: 100%; padding: 24px 36px; border-radius: var(--row-radius); background: rgba(255,255,255,0.08); color: #fff; transition: transform 150ms var(--ease), background-color 150ms; }
.gm-listrow .gm-quiet { color: var(--muted); }
.gm-listrow.focused { background: #fff; color: #000; transform: scale(1.015); }
.gm-listrow.focused .gm-quiet { color: #3a3a3a; }

/* PosterCard: scale 1.08 with a white 2dp border on focus */
.gm-poster { position: relative; flex: none; border-radius: var(--poster-radius); background: var(--surface); transition: transform 180ms var(--ease); }
.gm-poster-art { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: var(--poster-radius); overflow: hidden; background: var(--surface); }
.gm-poster-art > img { position: absolute; top: 0; left: 0; }
.gm-poster.focused { transform: scale(1.08); z-index: 2; }
.gm-poster.focused::after { content: ""; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; border: 4px solid #fff; border-radius: calc(var(--poster-radius) + 4px); pointer-events: none; }
.gm-poster-label { position: absolute; top: 0; left: 50%; transform: translateX(-50%); background: rgba(41,41,41,0.92); color: #fff; font-size: 22px; font-weight: 600; white-space: nowrap; padding: 6px 14px 7px; border-radius: 0 0 9px 9px; }
.gm-poster-rank { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,0.8); color: #fff; font-size: 26px; font-weight: 700; padding: 6px 18px; border-radius: 999px; }

.gm-seeall { width: var(--poster-w); height: var(--poster-h); flex: none; border-radius: var(--poster-radius); background: rgba(255,255,255,0.08); color: var(--silver); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform 180ms var(--ease), background-color 150ms; }
.gm-seeall.focused { background: #fff; color: #000; transform: scale(1.08); }

.gm-shelf { padding-top: 12px; }

/* TvTextField */
.gm-field { display: block; width: 100%; padding: 28px 32px; border-radius: var(--field-radius); background: rgba(255,255,255,0.08); color: #fff; font-size: 30px; border: 4px solid transparent; }
.gm-field.focused { background: rgba(255,255,255,0.2); border-color: #fff; }
input.gm-field, textarea.gm-field { font-family: inherit; outline: none; background: rgba(255,255,255,0.14); border-color: #fff; caret-color: #fff; resize: none; }
input.gm-field::placeholder, textarea.gm-field::placeholder { color: var(--muted); }

/* A review source without an icon in the pack (WeTrakr): its name on a small tile. */
.gm-rating-word { display: inline-block; padding: 2px 6px; border-radius: 6px; background: #fff; color: #000; font-weight: 800; letter-spacing: 0; white-space: nowrap; text-align: center; }

/* What's New, once after an update (Apple's WhatsNewView). */
.gm-whatsnew { position: fixed; top: 0; left: 0; width: 1920px; height: 1080px; background: #0b0b0d; z-index: 60; }
.gm-whatsnew-column { position: absolute; top: 64px; left: 310px; width: 1300px; }
.gm-whatsnew-title { color: #fff; font-size: 64px; font-weight: 700; margin-bottom: 32px; }
.gm-whatsnew .gm-page { position: relative; overflow: hidden; }
.gm-whatsnew-row { display: flex; align-items: flex-start; padding: 20px 28px; border-radius: 28px; margin-bottom: 12px; }
.gm-whatsnew-row.focused { background: rgba(255, 255, 255, 0.08); }
.gm-whatsnew-text { margin-left: 32px; }
.gm-whatsnew-item { color: #fff; font-size: 36px; font-weight: 600; }
.gm-whatsnew-detail { color: var(--muted); font-size: 28px; line-height: 1.35; margin-top: 6px; }
