/* PS3 World - home styles (loaded after style.css on the pages that need them) */

/* Share button (home) */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.share-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.share-btn:hover {
  border-color: var(--ps-blue-2);
  background: var(--card-2);
  color: var(--ps-cyan);
  box-shadow: 0 6px 24px rgba(43, 143, 255, 0.15);
  transform: translateY(-1px);
}

.share-btn:active { transform: none; }

.share-btn.copied {
  border-color: rgba(86, 227, 159, 0.4);
  background: rgba(86, 227, 159, 0.08);
  color: var(--p3t);
}

/* ---------- 6.7 Section headings & quick-nav grids ---------- *//* Shared section heading: uppercase title with a short glowing underline */
.updates-widget {
  position: relative;
  max-width: 100%;
  padding: 30px;
  border-radius: var(--radius-lg);
}

.widget-header {
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(74, 158, 255, 0.2);
}

.widget-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--ps-sky), transparent);
}

.widget-title {
  margin: 0;
  line-height: 1.2;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

/* What's New + sidebar */
.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  align-items: start;
  gap: 40px;
  margin-top: 56px;
}

.home-columns .updates-widget { padding: 0; }

/* What's New fills the height of "More from PS3 World" beside it */
@media (min-width: 1001px) {
  .home-columns { align-items: stretch; }
  .home-columns .updates-widget { display: flex; flex-direction: column; }
  .home-columns .updates-widget .feed-list { flex: 1; justify-content: space-between; }
  .home-columns .updates-widget.is-fitting { display: block; }
  .home-side { align-self: start; }

  /* Older posts on one line each so more of them fit */
  .home-columns .feed-item:not(.feed-item--lead) {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
  }
  .home-columns .feed-item:not(.feed-item--lead) .feed-meta { flex: 0 0 236px; flex-wrap: nowrap; gap: 8px; }
  .home-columns .feed-item:not(.feed-item--lead) .feed-tag { min-width: 92px; text-align: center; }
  .home-columns .feed-item:not(.feed-item--lead) .feed-date { min-width: 80px; }
  .home-columns .feed-item:not(.feed-item--lead) .feed-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.side-card {
  --accent: var(--ps-blue-2);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  color: var(--text);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.side-card--themes { --accent: #c39be0; }

.side-card--avatars { --accent: var(--ps-cyan); }

.side-card--manuals { --accent: var(--tag-ports); }

.side-card--random { --accent: var(--gold); }

.side-card--lite { --accent: var(--p3t); }

.side-card--lb { --accent: #ff4d4d; }

.side-card-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.side-card-live[hidden] { display: none; }

.lb-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  animation: lbPulse 2s infinite;
}

@keyframes lbPulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

@media (prefers-reduced-motion: reduce) { .lb-dot { animation: none; } }

.side-card:hover {
  border-color: var(--border-2);
  border-left-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--text);
  transform: translateX(4px);
}

.side-card-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.side-card-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.side-card-desc {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.side-card-arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.side-card:hover .side-card-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ---------- 6.20 What's New preview (home) ---------- */
.updates-widget .widget-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feed-fresh {
  padding: 4px 12px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--pill);
  background: rgba(255, 107, 107, 0.08);
  color: var(--new-text);
  font-size: 12px;
  font-weight: 700;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--feed-accent, var(--ps-sky));
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.feed-item:hover {
  border-color: var(--border-2);
  border-left-color: var(--feed-accent, var(--ps-sky));
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: translateX(4px);
}

/* Newest post gets more room and a short summary */
.feed-item--lead {
  gap: 8px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(43, 143, 255, 0.1), rgba(255, 255, 255, 0.02) 60%);
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.feed-title {
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.feed-item--lead .feed-title { font-size: 19px; font-weight: 700; }

.feed-item:hover .feed-title { color: var(--ps-cyan); }

.feed-summary {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.feed-date {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
}

.updates-widget .new-badge {
  padding: 2px 9px;
  border-radius: var(--pill);
  background: var(--new-grad);
  box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.updates-widget .view-more-container { margin-top: 18px; }

.updates-widget .view-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: var(--pill);
  background: rgba(74, 158, 255, 0.08);
  color: var(--ps-sky);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s var(--ease);
}

.updates-widget .view-more-btn:hover {
  border-color: var(--ps-sky);
  background: rgba(74, 158, 255, 0.18);
  color: #fff;
}

/* Loading placeholders */
.feed-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-skel {
  height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.feed-skel--lead { height: 118px; border-radius: var(--radius); }

.feed-error { color: var(--text-3); }

@media (max-width: 1000px) {
  .home-columns { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 720px) {
  .updates-widget { padding: 20px; }
  .widget-title { font-size: 18px; }
  /* Share */
.share-btn {
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
  }
}

@media (max-width: 480px) {
  .updates-widget { padding: 16px; }
}

/* ---------- Add to Home Screen (js/install.js) ---------- */
.share-btn[hidden] { display: none; }

.a2hs {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.a2hs.is-open { visibility: visible; pointer-events: auto; }

.a2hs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.7);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.a2hs.is-open .a2hs-backdrop { opacity: 1; }

.a2hs-panel {
  position: relative;
  width: min(520px, 100%);
  margin: 0 12px calc(12px + env(safe-area-inset-bottom));
  padding: 24px 22px 20px;
  border: 1px solid var(--border-2, var(--border));
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(74, 217, 255, 0.06);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.25s var(--ease);
}

.a2hs.is-open .a2hs-panel { transform: none; opacity: 1; }

.a2hs-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.a2hs-close:focus-visible { outline: none; box-shadow: var(--ring); }

.a2hs-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 34px;
}

.a2hs-head img { flex-shrink: 0; border-radius: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }

.a2hs-head h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.a2hs-head p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }

.a2hs-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: a2hs;
}

.a2hs-steps li {
  position: relative;
  margin: 0 0 10px;
  padding: 12px 14px 12px 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.5;
  counter-increment: a2hs;
}

.a2hs-steps li::before {
  content: counter(a2hs);
  position: absolute;
  top: 50%;
  left: 14px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  border-radius: 50%;
  background: rgba(74, 217, 255, 0.14);
  color: var(--ps-cyan);
  font-size: 12px;
  font-weight: 800;
}

.a2hs-steps b { color: #fff; }

.a2hs-ico {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0 2px;
  border-radius: 7px;
  background: rgba(74, 217, 255, 0.12);
  color: var(--ps-cyan);
  vertical-align: middle;
}

.a2hs-ico svg { width: 16px; height: 16px; }

.a2hs-note { margin: 4px 2px 0; color: var(--text-3); font-size: 13px; }

@media (min-width: 721px) {
  .a2hs { align-items: center; }
  .a2hs-panel { margin: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .a2hs-panel, .a2hs-backdrop { transition: none; }
}

@media (max-width: 720px) {
  .hero-actions .share-btn { flex: 1 1 calc(50% - 6px); width: auto; padding: 14px 12px; white-space: nowrap; }
  .hero-actions .share-btn[hidden] { display: none; }
  .hero-actions .share-btn:only-of-type,
  .hero-actions .share-btn:has(+ .share-btn[hidden]) { flex-basis: 100%; }
  .install-btn .hide-sm { display: none; }
}

/* Keep the hero buttons above the character art when they run wide */
.home-hero .hero-actions { z-index: 3; }

/* ---- Handy tools: small cards under Explore ---- */
.mini-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mini-tool {
  --mt: var(--ps-sky);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--panel-top), var(--panel-bottom));
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.mini-tool:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--mt) 55%, transparent); }
.mini-tool:focus-visible { outline: none; box-shadow: var(--ring); }
.mini-tool--check  { --mt: #3ddc84; }
.mini-tool--wizard { --mt: #4a9eff; }
.mini-tool--errors { --mt: #f5a524; }
.mini-tool--gloss  { --mt: #b78cff; }
.mini-tool--pad    { --mt: #ff5c7a; }
.mini-tool--buy    { --mt: #2bd4d9; }

.mini-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--mt) 15%, transparent);
  color: var(--mt);
}
.mini-icon svg { width: 21px; height: 21px; }

.mini-text { display: grid; gap: 2px; min-width: 0; }
.mini-text strong { font-size: 15px; line-height: 1.3; }
.mini-text span { color: var(--text-2); font-size: 14px; line-height: 1.4; }

@media (max-width: 600px) {
  .mini-tools { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

@media (min-width: 601px) and (max-width: 1000px) {
  .mini-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- More from PS3 World: exclusives card ---- */
.side-card--exclusives { --accent: #ff5c7a; }

/* ---- This Day in PS3 History ---- */
.th-widget { margin: 56px 0 64px; }
.th-widget[hidden] { display: none; }
.th-widget .widget-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.th-nav { display: flex; align-items: center; gap: 8px; }
.th-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.th-btn svg { width: 16px; height: 16px; }
.th-btn:hover { border-color: var(--ps-sky); color: #fff; }
.th-btn:focus-visible, .th-today:focus-visible { outline: 2px solid var(--ps-cyan); outline-offset: 2px; }
.th-date {
  min-width: 150px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.th-today {
  padding: 7px 12px;
  border: 1px solid rgba(74, 217, 255, 0.4);
  border-radius: var(--pill);
  background: rgba(43, 143, 255, 0.12);
  color: var(--ps-cyan);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.th-today[hidden] { display: none; }

.th-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  min-height: 84px;
}
.th-note { grid-column: 1 / -1; margin: 0; color: var(--text-3); font-size: 13.5px; }
.th-item {
  --th: var(--ps-sky);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--th);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--panel-top), var(--panel-bottom));
}
.th-item--game { --th: #3ddc84; }
.th-item--console { --th: #4a9eff; }
.th-item--firmware { --th: #b78cff; }
.th-item--psn { --th: #f5a524; }
.th-item--event { --th: #4ad9ff; }
.th-year {
  flex: none;
  padding: 3px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--th) 15%, transparent);
  color: var(--th);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.th-body { min-width: 0; }
.th-text { margin: 0 0 4px; color: var(--text); font-size: 15px; line-height: 1.45; }
.th-meta { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: 0.4px; }

@media (max-width: 600px) {
  .th-widget { margin: 40px 0 48px; }
  .th-nav { width: 100%; justify-content: space-between; }
  .th-date { flex: 1; min-width: 0; }
}

/* Phones: one full-width "Start here", then homebrew, RPCS3 and an icon-only Share on one row */
.hero-pc .show-sm { display: none; }
@media (max-width: 720px) {
  .hero-actions .btn:first-child { flex: 1 1 100%; }
  .hero-actions .btn-ghost { flex: 1 1 0; min-width: 0; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
  .hero-pc .hide-sm { display: none; }
  .hero-pc .show-sm { display: inline; }
  .hero-actions #shareBtn { flex: 0 0 auto; width: auto; padding: 14px; }
  .hero-actions #shareBtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* "Add to Home Screen" (shown by install.js on phones) gets its own row */
  .hero-actions .install-btn { flex: 1 1 100%; }
}

/* PS3 World App promo under the hero buttons */
.home-hero .hero-app {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(74, 158, 255, 0.08);
  color: var(--text-2, #c3cad8);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}
@media (max-width: 600px) {
  .home-hero .hero-app { display: flex; align-items: flex-start; border-radius: 16px; font-size: 14px; }
  .home-hero .hero-app .hero-app-badge { margin-top: 1px; }
}
.home-hero .hero-app:hover,
.home-hero .hero-app:focus-visible { border-color: var(--ps-sky); background: rgba(74, 158, 255, 0.16); color: #fff; }
.home-hero .hero-app strong { color: #fff; }
.hero-app-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--new-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- Hero: two buttons, then a plain link for PC players ---- */
.hero-actions .hero-textlink {
  align-self: center;
  padding: 6px 4px;
  color: var(--link);
  font-size: var(--fs-md);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 4px;
}
.hero-actions .hero-textlink:hover { text-decoration-color: currentColor; }
@media (max-width: 720px) {
  .hero-actions .hero-textlink { flex: 1 1 100%; text-align: center; }
}

/* ---- Footer share ---- */
.footer-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--pill);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.footer-share:hover { border-color: var(--link); color: #fff; }
.footer-share.copied { border-color: var(--green); color: var(--green); }
