/* The player (src/player/PlayerActivity.tsx, InfoBar.tsx, OptionsPanel.tsx).
   Sizes are Android dp/sp x 2. AVPlay paints the picture on a plane BEHIND
   the page, so while the player is up the page is transparent and the app
   underneath is hidden (visibility, so nothing paints, backgrounds included). */

html.gm-playing,
body.gm-playing { background: transparent !important; }
body.gm-playing #root { visibility: hidden; background: transparent; }

.gm-player {
  visibility: visible;
  position: fixed;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  z-index: 1000;
  background: transparent;
  color: #fff;
}
.gm-player-video { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; }

/* ---- subtitles (external file / embedded cues) ---- */
.gm-player-subs {
  position: absolute;
  left: 160px;
  right: 160px;
  bottom: 96px;
  text-align: center;
  font-size: 54px;
  line-height: 1.25;
  font-weight: 500;
  color: #fff;
  pointer-events: none;
  transition: bottom 200ms var(--ease);
}
.gm-player-subs span {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  text-shadow: 0 0 6px #000, 0 2px 4px #000, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}
.gm-player.controls-up .gm-player-subs { bottom: 340px; }

/* ---- buffering (ExoPlayer's show_buffering="when_playing") ---- */
@keyframes gm-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.gm-player-spinner {
  position: absolute;
  top: 492px;
  left: 912px;
  width: 96px;
  height: 96px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: gm-spin 0.9s linear infinite;
}

/* ---- format tags: top|start, 36dp / 28dp ---- */
.gm-player-tags { position: absolute; top: 56px; left: 72px; display: flex; flex-direction: row; z-index: 2; }
.gm-player-tag {
  margin-right: 16px;
  padding: 6px 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.25);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

/* ---- cards: 18dp radius, #1C1C1E at 90%, 1dp white 20% stroke ---- */
.gm-player-card {
  position: absolute;
  border-radius: 36px;
  background: rgba(28, 28, 30, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}
.gm-skip-card { right: 96px; bottom: 220px; padding: 36px 44px; display: flex; flex-direction: column; align-items: flex-start; }
.gm-skip-kind { font-size: 26px; font-weight: 700; letter-spacing: 0.12em; }
.gm-skip-title { margin-top: 12px; font-size: 40px; font-weight: 700; color: #fff; }
.gm-skip-hint { margin-top: 8px; font-size: 28px; color: #a1a1aa; }

.gm-postcredits { top: 96px; right: 96px; padding: 36px 44px; }
.gm-postcredits-title { font-size: 36px; font-weight: 700; color: #fff; }
.gm-postcredits-sub { font-size: 28px; color: #a1a1aa; }

.gm-player-toast { top: 96px; left: 50%; transform: translateX(-50%); padding: 24px 40px; font-size: 32px; color: #fff; white-space: nowrap; }

/* ---- Up Next, full screen ---- */
.gm-upnext {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  box-sizing: border-box;
  padding: 160px;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 5;
}
.gm-upnext-caption { font-size: 36px; font-weight: 700; letter-spacing: 0.15em; }
.gm-upnext-title {
  margin-top: 44px;
  font-size: 68px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  max-height: 3.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.gm-upnext-count { margin-top: 44px; font-size: 36px; color: #a1a1aa; }

/* ---- error ---- */
.gm-player-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  box-sizing: border-box;
  padding: 64px;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 6;
}
.gm-player-error-title { font-size: 44px; font-weight: 700; color: #c7ccd6; }
.gm-player-error-detail { margin-top: 16px; font-size: 26px; color: #8c8c8c; max-width: 1400px; word-wrap: break-word; }
.gm-player-error-hint { margin-top: 24px; font-size: 32px; color: #c7ccd6; }
.gm-player-error-button { margin-top: 48px; }
.gm-player-error-button .gm-pill.focused { background: #fff; color: #000; transform: scale(1.1); }

/* ---- InfoBar ---- */
.gm-infobar { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; pointer-events: none; }
.gm-infobar .gm-ib-bottom, .gm-infobar .gm-ib-header { pointer-events: auto; }
.gm-ib-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 140px 96px 48px 96px;
  display: flex;
  flex-direction: row;
  align-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
}
.gm-ib-title { flex: 1 1 0; min-width: 0; font-size: 44px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.67); }
.gm-ib-speed { flex: none; padding-right: 36px; font-size: 30px; color: #c7ccd6; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.67); }
.gm-ib-clock { flex: none; font-size: 40px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.67); }

.gm-ib-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 80px 96px 96px 96px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}
.gm-ib-line { display: flex; flex-direction: row; align-items: center; }
.gm-ib-pause { flex: none; margin-right: 32px; font-size: 36px; }
.gm-ib-elapsed { flex: none; font-size: 32px; color: #fff; }
.gm-ib-total { flex: none; font-size: 32px; color: #c7ccd6; }
.gm-ib-seek { flex: 1 1 0; min-width: 0; margin: 0 32px; padding: 12px 0; border-radius: 999px; }
.gm-ib-track { position: relative; height: 20px; border-radius: 10px; background: rgba(255, 255, 255, 0.25); overflow: hidden; transition: height 150ms; }
.gm-ib-seek.focused .gm-ib-track { height: 28px; border-radius: 14px; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5); overflow: visible; }
.gm-ib-loaded, .gm-ib-played { position: absolute; top: 0; left: 0; height: 100%; border-radius: inherit; }
.gm-ib-loaded { background: rgba(255, 255, 255, 0.4); }
.gm-ib-played { background: #fff; }
.gm-ib-shade { position: absolute; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; }

.gm-ib-skip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 24px 52px;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.8);
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  z-index: 3;
}

/* ---- transport buttons (ExoPlayer's controller) ---- */
.gm-ib-controls { margin-top: 28px; }
.gm-ctl-row { display: flex; flex-direction: row; align-items: center; }
.gm-ctl-spacer { flex: 1 1 0; }
.gm-ctl {
  flex: none;
  margin-right: 24px;
  width: 88px;
  height: 88px;
  border-radius: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transition: transform 150ms var(--ease), background-color 150ms;
}
.gm-ctl.focused { background: #fff; color: #000; transform: scale(1.1); }

/* ---- OptionsPanel: 560dp wide, end|center_vertical, 48dp from the edge ---- */
.gm-opanel-host { position: absolute; top: 0; right: 96px; height: 1080px; display: flex; flex-direction: column; justify-content: center; z-index: 4; }
.gm-opanel {
  width: 1120px;
  box-sizing: border-box;
  padding: 36px;
  border-radius: 44px;
  background: rgba(28, 28, 30, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.gm-opanel-tabs { overflow: hidden; width: 100%; }
.gm-opanel-tabs-track { display: flex; flex-direction: row; white-space: nowrap; transition: transform 150ms var(--ease); }
.gm-opanel-tab { flex: none; margin-right: 12px; padding: 14px 28px; border-radius: 999px; font-size: 30px; font-weight: 700; color: #c7ccd6; }
.gm-opanel-tab.current { background: #fff; color: #000; }
.gm-opanel-list { margin-top: 28px; }
.gm-opanel-row { display: flex; flex-direction: row; align-items: center; margin-top: 4px; padding: 20px 28px; border-radius: 28px; color: #fff; }
.gm-opanel-row.cursor { background: #fff; color: #000; }
.gm-opanel-texts { flex: 1 1 0; min-width: 0; }
.gm-opanel-title { font-size: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-opanel-detail { font-size: 26px; color: #a1a1aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-opanel-row.cursor .gm-opanel-detail { color: #3a3a3c; }
.gm-opanel-check { flex: none; margin-left: 16px; font-size: 36px; color: #ffd60a; }
.gm-opanel-row.cursor .gm-opanel-check { color: #000; }
.gm-opanel-empty { font-size: 30px; color: #a1a1aa; }

/* Recovery (Apple's build 252): "Trying the next source…" over the picture. */
.gm-player-recovery {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 64px;
  border-radius: 36px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 32px;
  max-width: 1100px;
  text-align: center;
}
.gm-player-spinner.gm-player-spinner-inline {
  position: relative;
  top: auto;
  left: auto;
  width: 72px;
  height: 72px;
  margin-bottom: 32px;
}
