/* G@M£$ */

:root {
  --bg: #f6f6f7;
  --surface: #ffffff;
  --ink: #15161a;
  --ink-2: #3c3f47;
  --muted: #71747e;
  --line: #e2e3e7;
  --line-2: #c9cbd2;
  --accent: #e8402a;
  --radius: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; }

img { max-width: 100%; display: block; }

button,
input { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}
.skip:focus { top: 10px; }

/* header */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.bar-in {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 58px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  flex: none;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
}

.search:focus-within { border-color: var(--ink-2); }

.search .ico {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: none;
  font-size: 14px;
}

.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }

.search-clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #ececef;
  color: var(--ink-2);
}

.search-clear .ico { width: 12px; height: 12px; }

.bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn:hover { background: #f1f1f3; }

.btn .ico { width: 15px; height: 15px; }

.btn b {
  min-width: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ececef;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.btn[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.btn[aria-pressed="true"] b { background: rgba(255, 255, 255, 0.18); }

.btn[aria-pressed="true"] .ico { fill: currentColor; }

.btn-dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover { background: #2c2e34; }

.btn-accent {
  border-color: var(--ink);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.btn-accent:hover { background: #f1f1f3; }

/* toolbar */

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 18px 64px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 14px;
}

.toolbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.count {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  vertical-align: 2px;
}

.shown {
  margin-left: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  vertical-align: 2px;
}

.sorts {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.sorts button {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.sorts button:first-child { border-left: 0; }
.sorts button:hover { background: #f4f4f6; }

.sorts button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

/* continue playing */

.continue { margin: 2px 0 22px; }

.continue-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  max-width: 620px;
}

.continue-thumb {
  width: 168px;
  height: 126px;
  flex: none;
  border-radius: 7px;
  object-fit: cover;
  background: #ececef;
}

.continue-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 2px 0;
}

.continue-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.continue-body h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.continue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.continue-actions .btn { text-decoration: none; }

.continue-actions .btn-dark .ico { width: 12px; height: 12px; fill: currentColor; stroke: none; }

/* recently played */

.recent { margin: 2px 0 20px; }

.recent h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recent-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  max-width: 240px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.recent-chip:hover { border-color: var(--line-2); }

.recent-chip img {
  width: 44px;
  height: 33px;
  border-radius: 5px;
  object-fit: cover;
  background: #ececef;
}

.recent-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px 14px;
}

.tile {
  content-visibility: auto;
  contain-intrinsic-size: 210px;
  position: relative;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: 168px 190px;
}

.tile-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.tile-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ececef;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.tile-open:hover .tile-thumb,
.tile-open:focus-visible .tile-thumb {
  border-color: var(--line-2);
  box-shadow: 0 6px 16px rgba(21, 22, 26, 0.1);
}

.tile-open:hover .tile-thumb img { transform: scale(1.03); }

.tile-thumb.is-broken::after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b4b7bf;
  font-size: 40px;
  font-weight: 700;
  background: #f0f0f2;
}

.tile-rating {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(21, 22, 26, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

.tile-rating::before {
  content: "★ ";
  color: #ffd34d;
}

.tile-rating[data-new]::before { content: none; }

.tile-played {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: 0.01em;
}

/* The one title the wall leads with: a plain file, playable offline. */
.tile-file {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(15, 157, 88, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: 0.02em;
}

.tile-play {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px 0 6px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.tile-play .ico {
  width: 11px;
  height: 11px;
  fill: currentColor;
  stroke: none;
}

.tile-open:hover .tile-play,
.tile-open:focus-visible .tile-play {
  opacity: 1;
  transform: none;
}

.tile-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.tile-meta {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.tile-fav {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease;
}

.tile-fav .ico { width: 15px; height: 15px; }

.tile:hover .tile-fav,
.tile-fav:focus-visible,
.tile-fav.is-on { opacity: 1; }

.tile-fav:hover { color: var(--ink); }

.tile-fav.is-on { color: var(--accent); }
.tile-fav.is-on .ico { fill: currentColor; }

.empty {
  margin: 40px 0;
  color: var(--ink-2);
  font-size: 15px;
}

.empty b { color: var(--ink); }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* footer */

.foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.foot p {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.sep { margin: 0 6px; color: var(--line-2); }

.foot-data {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding-top: 0;
  font-size: 12px;
}

.foot [data-storage-note].is-warn { color: var(--accent); }

/* player */

.player {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #0e0f12;
}

.player[hidden] { display: none; }

.player-top {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 10px;
  background: #16171b;
  border-bottom: 1px solid #26272d;
}

.pbtn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e8e9ed;
  text-decoration: none;
}

.pbtn:hover { background: #26272d; }

.pbtn[aria-pressed="true"] { background: #e8e9ed; color: #16171b; }

.player-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.player-meta b {
  color: #f2f3f5;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta span {
  color: #8c8f99;
  font-size: 11.5px;
}

.player-tools {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.player-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.player-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-load {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0e0f12;
  color: #9a9da7;
  font-size: 13px;
}

.player-load[hidden] { display: none; }

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #2d2f36;
  border-top-color: #e8e9ed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.load-link {
  padding: 6px 12px;
  border: 1px solid #33353d;
  border-radius: 6px;
  color: #e8e9ed;
  font-size: 12.5px;
  text-decoration: none;
}

.load-link:hover { background: #1c1d22; }

.player-source {
  color: #6f727c;
  font-size: 11px;
}

.pbtn-wide {
  width: auto;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

.player-blocked {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 32px clamp(20px, 6vw, 72px);
  background: #0e0f12;
  color: #d9dbe2;
  overflow: auto;
}

.player-blocked[hidden] { display: none; }

.player-blocked h2 {
  margin: 0;
  color: #f3f4f7;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.player-blocked p { margin: 0; max-width: 60ch; font-size: 13.5px; line-height: 1.5; }

.blocked-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

.blocked-list a { color: #cfd2da; }

.blocked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.blocked-actions .btn { width: auto; }

.blocked-apology { color: #7f828c; font-size: 12.5px; }

.build {
  color: #a7aab3;
  font-variant-numeric: tabular-nums;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 2px;
}

.tags[hidden] { display: none; }

.tag {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  color: #4a4d57;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.tag:hover { background: #f3f4f6; }

.tag[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.more-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}

.more-wrap .btn {
  min-width: 180px;
  justify-content: center;
}

.more-wrap .btn[hidden] { display: none; }

.tile-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #eceef1;
  color: #9a9ea8;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tile-mirrors {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(21, 22, 26, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
}

.tile:hover .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 2px;
}

.tags[hidden] { display: none; }

.tag {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  color: #4a4d57;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.tag:hover { background: #f3f4f6; }

.tag[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.more-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}

.more-wrap .btn {
  min-width: 180px;
  justify-content: center;
}

.more-wrap .btn[hidden] { display: none; }

.tile-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #eceef1;
  color: #9a9ea8;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tile-mirrors { opacity: 0; }


/* small screens */

@media (hover: none) {
  .tile-play { display: none; }
  .tile-fav { opacity: 1; }
}

@media (max-width: 780px) {
  .bar-in {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  .logo { font-size: 19px; }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .wrap { padding: 0 12px 48px; }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 0 12px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 14px 10px;
  }

  .continue-card { max-width: none; }
  .continue-thumb { width: 108px; height: 81px; }
  .continue-body h2 { font-size: 15px; }

  .tile-title { font-size: 12.5px; }
  .tile-meta { font-size: 11.5px; }
}

@media (max-width: 460px) {
  /* the local-files link keeps its words: it is the one button whose label
     says what it does, and an icon alone would not */
  .bar-actions [data-saved-toggle] span { display: none; }
  .bar-actions [data-saved-toggle] { padding: 0 10px; }
  .btn-local { padding: 0 9px; font-size: 12.5px; }
  .player-meta span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* 404 */

.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 18px;
}

.notfound .logo { font-size: 30px; }

.notfound h1 {
  margin: 12px 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.notfound p {
  margin: 0 0 22px;
  color: var(--muted);
}

.notfound .btn { text-decoration: none; }

/* local files */

.files-crumb {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.files-crumb span {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 620px) {
  .files-crumb span { display: none; }
}

.files-hero {
  padding: 34px 0 26px;
  max-width: 720px;
}

.files-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.files-kicker .ico {
  width: 14px;
  height: 14px;
}

.files-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.files-lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
}

.files-lede-2 {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.files-lede-2 a {
  color: var(--ink-2);
  font-weight: 600;
}

.files-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.files-facts li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.files-facts b {
  margin-right: 4px;
  color: var(--ink);
  font-weight: 800;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 20px 18px;
  padding-bottom: 28px;
}

.file-card {
  min-width: 0;
}

.file-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
}

.file-art {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #ececef;
  box-shadow: 0 6px 18px rgba(21, 22, 26, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.file-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.file-open:hover .file-art img,
.file-open:focus-visible .file-art img { transform: scale(1.06); }

/* legibility gradient + shine sweep so every thumbnail looks finished */
.file-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 24, 0) 55%, rgba(10, 12, 24, 0.28) 100%);
}

.file-art::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -30%;
  width: 34%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg) translateX(-120%);
  transition: transform 0.6s ease;
}

.file-open:hover .file-art::before,
.file-open:focus-visible .file-art::before { transform: skewX(-18deg) translateX(620%); }

.file-art.is-broken {
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #1d2027, #33373f);
}

.file-art.is-broken::after {
  content: attr(data-initial);
  color: rgba(255, 255, 255, 0.42);
  font-size: 54px;
  font-weight: 800;
}

.file-open:hover .file-art,
.file-open:focus-visible .file-art {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 14px 30px rgba(21, 22, 26, 0.14);
}

.file-badge {
  position: absolute;
  left: 9px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: rgba(10, 40, 24, 0.82);
  color: #7dffb0;
  border: 1px solid rgba(125, 255, 176, 0.35);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #2bde7d;
  vertical-align: 1px;
}

.file-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px 6px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.file-play .ico {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.file-open:hover .file-play,
.file-open:focus-visible .file-play { opacity: 1; transform: none; }

.file-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 2px 0;
}

.file-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.file-line {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
}

.file-how {
  color: var(--muted);
  font-size: 11.5px;
}

.files-note {
  margin: 0;
  padding: 20px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.files-note a {
  margin-left: 6px;
  color: var(--ink);
  font-weight: 600;
}

@media (hover: none) {
  .file-play { display: none; }
}

@media (max-width: 780px) {
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 16px 12px; }
  .file-title { font-size: 13px; }
  .file-line { font-size: 12px; }
}

@media (max-width: 460px) {
  .files-hero { padding: 22px 0 18px; }
}

.btn-local {
  position: relative;
  border-color: #14b866;
  background: linear-gradient(180deg, #e9fbf0, #d3f5e1);
  color: #0a5c36;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(20, 184, 102, 0.25), 0 4px 14px rgba(20, 184, 102, 0.18);
}

.btn-local::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #14b866;
  box-shadow: 0 0 0 0 rgba(20, 184, 102, 0.55);
  animation: pulse 2.2s ease-out infinite;
}

.btn-local:hover {
  background: linear-gradient(180deg, #ddf8e8, #c6f1d6);
  border-color: #0ea25a;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 102, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(20, 184, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 102, 0); }
}

/* unblocked tools: filter + surprise */

.files-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.files-search { flex: 1; max-width: 460px; }

.files-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .files-tools { flex-wrap: wrap; }
  .files-search { flex-basis: 100%; max-width: none; }
  .files-count { margin-left: 0; }
}

/* stealth footer: cloaks, blank tab, quick exit */

.foot-stealth {
  align-items: center;
  padding-bottom: 18px;
}

.stealth-label {
  font-weight: 600;
}

.cloak {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.cloak button {
  padding: 4px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.cloak button:first-child { border-left: 0; }
.cloak button:hover { background: #f3f4f6; }

.cloak button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.panic-hint { color: #a7aab3; }

.foot kbd,
.files-hero kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
}

/* Filters, local display preferences, and offline/PWA controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.filter-bar label { display: inline-flex; align-items: center; gap: 7px; }
.filter-bar select {
  min-height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}
.filter-bar .link { font-size: 12px; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.player-description { max-width: min(60vw, 740px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-report { color: #b8c7ff; font-size: 11px; text-decoration: underline; white-space: nowrap; }
.offline-status { margin: 0; padding: 5px 12px; background: #202127; color: #eceef3; font-size: 12px; }
.offline-status:empty { display: none; }
[data-offline-game] { min-width: 116px; }
[data-offline-game]:disabled { opacity: .65; cursor: progress; }
.site-settings { align-items: center; }
.site-settings button, .site-settings a { font-size: 12px; }
.large-text body { font-size: 17px; }
.large-text .tile-title { font-size: 15px; }
.large-text .tile-meta, .large-text .btn, .large-text .tag { font-size: 14px; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --surface: #1a1d24;
  --ink: #f2f4f8;
  --ink-2: #d1d5df;
  --muted: #a7adba;
  --line: #353944;
  --line-2: #505563;
  --accent: #ff7968;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .search,
html[data-theme="dark"] .btn,
html[data-theme="dark"] .sorts,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .recent-chip,
html[data-theme="dark"] .files-facts li,
html[data-theme="dark"] .files-kicker { background-color: var(--surface); color: var(--ink); }
html[data-theme="dark"] .sorts button[aria-pressed="true"],
html[data-theme="dark"] .btn-dark,
html[data-theme="dark"] .tag[aria-pressed="true"] { background: #f2f4f8; color: #15161a; }
html[data-theme="dark"] .search input { color: var(--ink); }
html[data-theme="dark"] .tile-thumb,
html[data-theme="dark"] .tile-thumb.is-broken::after,
html[data-theme="dark"] .tile-fallback { background: #252832; }
html[data-theme="dark"] .tile-fav { background: rgba(30, 33, 41, .95); color: var(--ink-2); }
html.high-contrast {
  --muted: #4c5058;
  --line: #7c8088;
  --line-2: #555a63;
}
html[data-theme="dark"].high-contrast { --muted: #e0e4ec; --line: #9ca3af; --line-2: #c2c8d2; }
html.high-contrast :focus-visible { outline: 3px solid #1463d6; outline-offset: 3px; }
html.high-contrast .tile-title, html.high-contrast .tile-meta,
html.high-contrast .files-note, html.high-contrast .foot p { font-weight: 650; }

@media (max-width: 780px) {
  .filter-bar { gap: 8px; }
  .filter-bar label { flex: 1 1 145px; justify-content: space-between; }
  .filter-bar select { flex: 1; min-width: 0; }
  .player-description { max-width: 42vw; }
}
@media (max-width: 460px) {
  .sorts { max-width: 100%; overflow-x: auto; }
  .sorts button { padding: 0 9px; font-size: 11.5px; white-space: nowrap; }
  .player-report { display: none; }
  .player-tools [data-offline-game] { width: auto; padding: 0 8px; font-size: 10px; }
}

/* The pitch above the wall: offline first, catalogue second. */
.pitch {
  margin: 26px 0 0;
}

.pitch-line {
  max-width: 760px;
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}

.pitch-line b { color: var(--ink); }

.pitch-line a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.pitch-line a:hover { color: var(--ink); }

@media (max-width: 620px) {
  .pitch { margin-top: 18px; }
  .pitch-line { margin-bottom: 16px; font-size: 14px; }
}

/* ---------- feedback ---------- */

body.fb-locked { overflow: hidden; }

.fb {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(11, 12, 16, .55);
}

.fb-sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 22px 24px 20px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(10, 12, 16, .28);
}

.fb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.fb-close:hover { background: var(--bg); color: var(--ink); }

.fb-kicker {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.fb-title { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }

.fb-lede { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }

.fb-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.fb-kinds legend {
  flex: 1 0 100%;
  width: 100%;
  margin-bottom: 7px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.fb-kind {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.fb-kind input { margin: 0; accent-color: var(--accent); }

.fb-kind.is-on { border-color: var(--accent); color: var(--accent); }

.fb-field { display: block; margin: 0 0 12px; }

.fb-field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.fb-field em { font-style: normal; font-weight: 400; color: var(--muted); }

.fb-field input,
.fb-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}

.fb-field textarea { min-height: 96px; resize: vertical; }

.fb-field input:focus,
.fb-field textarea:focus,
.fb-close:focus-visible,
.fb-cancel:focus-visible,
.fb-send:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.fb-error { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #c0392b; }

.fb-note { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }

.fb-note a { color: var(--accent); font-weight: 600; }

.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.fb-cancel,
.fb-send {
  padding: 9px 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.fb-cancel:hover { background: var(--bg); }

.fb-send { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.fb-send:hover { opacity: .92; }

.fb-alt { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

.fb-alt a { color: var(--accent); font-weight: 600; }

@media (max-width: 560px) {
  .fb { padding: 0; align-items: flex-end; }
  .fb-sheet {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 20px 18px 16px;
    border-radius: 16px 16px 0 0;
  }
  .fb-field input,
  .fb-field textarea { font-size: 16px; }
  .fb-actions { flex-direction: column-reverse; }
  .fb-cancel,
  .fb-send { width: 100%; padding: 12px 14px; }
}
