/* hr-animations.css — Animations grid (3×4, stretched media) */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial,
    sans-serif;
  background: #111;
  color: #eee;
}

/* Avoid mobile text auto-resize oddities */
html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
}

/* Main grid: 3 fixed columns on this page (JS will reapply inline) */
main#animationsGridContainer.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 1rem;
  box-sizing: border-box;
  align-content: start;
}

/* ───────────────────────────
   Animation cards
   ─────────────────────────── */

.animation-card {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #000;
  overflow: hidden;

  /* Shared fixed height for all cards (including control) */
  height: 220px;
}

/* Placeholder / empty slots */
.animation-card.placeholder {
  background: transparent;
  border-style: dashed;
  border-color: #fff;
  color: #aaa;
}

/* Non-empty hover */
.animation-card:not(.placeholder):hover {
  border-color: #fff;
  cursor: pointer;
}

/* Empty hover: dashed -> solid */
.animation-card.placeholder:hover {
  border-style: solid;
  border-color: #fff;
  cursor: pointer;
}

/* Control card: transparent shell, inner surface styled via JS */
.animation-card.control {
  background: transparent;
  border: none;
  height: 220px; /* keep in sync with .animation-card */
}

/* Surface inside each card */
.preview-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* For normal cards, preview surface has a black background */
.animation-card:not(.control) .preview-wrap {
  background: #000;
}

/* ───────────────────────────
   Badges
   ─────────────────────────── */

/* top-left number / slot badge */
.key-badge {
  position: absolute;
  top: 8px;
  left: 8px;

  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.6rem;
  border-radius: 10px;

  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;

  background: #000;
  color: #fff;
  opacity: 0.9;

  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* bottom-left KB file size badge */
.size-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #000;
  color: #fff;
  opacity: 0.85;
  pointer-events: none;
}

/* name-badge is styled inline from JS; we only hide empties */
.name-badge:empty,
.size-badge:empty {
  display: none;
}

/* ───────────────────────────
   Fullscreen overlay preview
   ─────────────────────────── */

#animOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  cursor: zoom-out;
}

#animOverlay[data-open="1"] {
  display: flex;
}

#animOverlayContent {
  width: 100vw;
  height: 100vh;
}

#animOverlayContent img,
#animOverlayContent video {
  width: 100%;
  height: 100%;
  object-fit: fill; /* fill screen, no letterboxing */
  object-position: center;
  display: block;
}

/* ───────────────────────────
   Control card button colors
   ─────────────────────────── */

.animation-card.control .preview-wrap button {
  height: 36px;
  padding: 0 0.9rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* RowTop: Export / Import (2nd child div inside preview-wrap) */
.animation-card.control .preview-wrap > div:nth-of-type(2) button {
  background: #90ee90;
  color: #000;
}

/* RowBottom: Settings / Scoreboard / Teams (3rd child div) */
.animation-card.control .preview-wrap > div:nth-of-type(3) button:nth-child(1) {
  background: #ffeb3b; /* Settings = yellow */
  color: #000;
}
.animation-card.control .preview-wrap > div:nth-of-type(3) button:nth-child(2) {
  background: #fff; /* Scoreboard = white */
  color: #000;
}
.animation-card.control .preview-wrap > div:nth-of-type(3) button:nth-child(3) {
  background: #1976d2; /* Teams = blue */
  color: #fff;
}

.animation-card.control .preview-wrap button:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}
.animation-card.control
  .preview-wrap
  > div:nth-of-type(3)
  button:nth-child(3):hover {
  filter: brightness(1.05);
}

/* Control card button rows: stretch buttons to card edges */
.animation-card.control .preview-wrap > div:nth-of-type(2),
.animation-card.control .preview-wrap > div:nth-of-type(3) {
  width: 100%;
  box-sizing: border-box;
}

.animation-card.control .preview-wrap > div:nth-of-type(2) > button,
.animation-card.control .preview-wrap > div:nth-of-type(3) > button {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Page header: title on left, KB counter on right */
.animations-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.animations-header-row h1 {
  margin: 0;
}

.animations-header-row #totalsKilobytesElement {
  font-weight: 700;
  white-space: nowrap;
}
