/* =========================================================
   NAPL — GAME DETAIL, SHOWCASE HERO & PORTS STYLES
   ========================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Editorial Showcase Hero */
.game-summary-card,
.game-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 28px;
  margin-bottom: 28px;
  background:
    radial-gradient(circle at top right, rgba(110, 231, 160, 0.12), transparent 56%),
    var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.game-hero-backdrop-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  user-select: none;
}

.game-hero-backdrop-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(13, 27, 21, 0.78) 0%,
    rgba(16, 33, 26, 0.62) 52%,
    rgba(13, 27, 21, 0.48) 100%
  );
}

html[data-theme="light"] .game-hero-backdrop-layer::after {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.84) 0%,
    rgba(244, 248, 247, 0.7) 54%,
    rgba(255, 255, 255, 0.54) 100%
  );
}

.game-hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(8px) saturate(1.25) brightness(0.92);
  transform: scale(1.07);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 260ms var(--ease-out);
}

.game-hero-backdrop.is-loaded {
  opacity: 1;
}

html[data-theme="light"] .game-hero-backdrop.is-loaded {
  opacity: 0.72;
}

.game-summary-card.is-entering,
.game-hero.is-entering {
  animation: napl-game-enter 190ms var(--ease-out) backwards;
}

html[data-theme="light"] .game-summary-card,
html[data-theme="light"] .game-hero {
  background:
    radial-gradient(circle at top right, rgba(15, 92, 82, 0.06), transparent 58%),
    var(--surface-1);
}

.game-summary-top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "cover header"
    "cover body";
  gap: 12px 28px;
  align-items: start;
}

.game-hero-media {
  grid-area: cover;
  width: 164px;
  view-transition-name: napl-hero-cover;
}

.game-summary-cover {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
}

.game-cover-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 14px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background:
    radial-gradient(circle at top, rgba(110, 231, 160, 0.14), transparent 70%),
    var(--surface-2);
  color: var(--accent);
}

.game-cover-fallback-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-summary-info {
  grid-area: header;
  min-width: 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .game-summary-info {
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.85);
}

.game-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
}

.game-summary-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  text-wrap: balance;
  view-transition-name: napl-hero-title;
}

.game-share-trigger {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.game-share-trigger.is-open::after {
  content: "";
  position: absolute;
  z-index: 32;
  top: calc(100% + 5px);
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--surface-2);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

.game-share-button {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.game-share-button:hover,
.game-share-trigger.is-open .game-share-button {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--accent);
}

.game-share-button:active {
  transform: scale(0.95);
}

.game-share-popover {
  position: absolute;
  z-index: 31;
  top: calc(100% + 10px);
  right: 0;
  width: 316px;
  max-width: min(316px, calc(100vw - 36px));
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  transform-origin: top right;
  text-shadow: none;
}

.game-share-popover:not([hidden]) {
  animation: napl-popover-down 170ms var(--ease-out) backwards;
}

.game-share-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.game-share-popover-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
}

.game-share-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.game-share-close:hover {
  background: var(--surface-3);
  color: var(--text-strong);
}

.game-share-platforms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.game-share-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    transform var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.game-share-platform:hover {
  background: var(--surface-3);
  color: var(--text-strong);
  transform: translateY(-1px);
}

.game-share-platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  color: #ffffff;
  transition: transform var(--duration-fast) var(--ease-out);
}

.game-share-platform:hover .game-share-platform-icon {
  transform: scale(1.05);
}

.game-share-platform.is-whatsapp .game-share-platform-icon {
  background: #25d366;
}

.game-share-platform.is-reddit .game-share-platform-icon {
  background: #ff4500;
}

.game-share-platform.is-x .game-share-platform-icon {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] .game-share-platform.is-x .game-share-platform-icon {
  border-color: rgba(0, 0, 0, 0.12);
}

.game-share-platform.is-facebook .game-share-platform-icon {
  background: #1877f2;
}

.game-share-platform-label {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.game-share-copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.game-share-copy-box.is-copied {
  border-color: var(--accent);
}

.game-share-url-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
  outline: none;
  text-overflow: ellipsis;
}

.game-share-url-input:focus {
  color: var(--text-strong);
}

.game-share-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  background: var(--cta-bg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.game-share-copy-btn:hover {
  background: var(--cta-hover);
}

.game-share-copy-btn:active {
  transform: scale(0.96);
}

.game-share-copy-btn.is-copied {
  background: var(--accent-surface);
  color: var(--accent);
  animation: napl-copy-pop 220ms var(--ease-out) backwards;
}

.game-share-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.game-share-toast svg {
  color: var(--accent);
  flex-shrink: 0;
}

.game-share-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .game-share-toast {
    transition: opacity 0.01ms;
    transform: translate(-50%, 0);
  }
}

.game-summary-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.game-summary-genre {
  display: inline;
}

.game-summary-meta-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}

.game-summary-meta-link:hover {
  color: var(--accent-hover);
}

.game-summary-meta-sep {
  color: var(--text-muted);
}

.game-hero-body {
  grid-area: body;
  min-width: 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .game-hero-body {
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.85);
}

.game-summary-description-container {
  max-width: 68ch;
}

.game-summary-description {
  margin: 0;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-line;
}

.game-summary-description.is-muted {
  color: var(--text-secondary);
}

.game-description-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 6px;
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  transition: color var(--duration-fast) var(--ease-out);
}

.game-description-toggle:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* Ports Section Header */
.ports-section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ports-section-bar[hidden] {
  display: none;
}

.ports-section-heading {
  min-width: 0;
}

.ports-section-title {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

.ports-section-description {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Ports Grid & Spotlight Card */
#port-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
}

#port-list .games-using-app-full {
  grid-column: 1 / -1;
}

.port-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.port-card.is-entering {
  animation: napl-game-enter 210ms var(--ease-out) backwards;
  animation-delay: calc(min(var(--enter-index, 0), 8) * 24ms);
}

.port-card:hover {
  border-color: var(--border-strong);
}

.port-card.is-spotlight {
  border-color: var(--border-strong);
  background:
    radial-gradient(circle at top right, rgba(245, 196, 81, 0.08), transparent 52%),
    var(--surface-1);
}

html[data-theme="light"] .port-card.is-spotlight {
  background:
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.06), transparent 52%),
    var(--surface-1);
}

@media (min-width: 780px) {
  #port-list.has-spotlight-full > .port-card:first-child {
    grid-column: 1 / -1;
  }
}

.port-top {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.port-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.port-spotlight-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.port-spotlight-kicker.is-gold {
  color: var(--gold);
}

.port-title {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.port-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.port-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.port-detail-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.port-detail-value {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

a.port-detail-value {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}

a.port-detail-value:hover {
  color: var(--accent-hover);
}

.port-inputs-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 19px;
}

.port-input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-strong);
  transition: color 0.16s ease;
}

.port-input-icon:hover {
  color: var(--accent);
}

.port-notes {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.port-notes-label {
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.port-notes-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.5;
  white-space: pre-line;
}

.port-link-row {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.port-link {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--cta-bg);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.port-link:hover {
  background: var(--cta-hover);
  color: #ffffff;
}

.port-report-link-trigger {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.port-report-link-button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(245, 196, 81, 0.5);
  background: rgba(245, 196, 81, 0.16);
  color: var(--gold);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.port-report-link-button:hover {
  background: rgba(245, 196, 81, 0.28);
  border-color: var(--gold);
  color: #fde68a;
}

.port-report-link-button:active {
  transform: scale(0.96);
}

html[data-theme="light"] .port-report-link-button {
  background: rgba(202, 138, 4, 0.12);
  border-color: rgba(161, 98, 7, 0.45);
  color: #854d0e;
}

html[data-theme="light"] .port-report-link-button:hover {
  background: rgba(202, 138, 4, 0.22);
  border-color: #a16207;
  color: #713f12;
}

.port-report-link-popover {
  position: absolute;
  z-index: 26;
  bottom: calc(100% + 10px);
  right: 0;
  width: 280px;
  max-width: min(280px, calc(100vw - 36px));
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-popover);
  transform-origin: bottom right;
}

.port-report-link-popover:not([hidden]) {
  animation: napl-popover-up 170ms var(--ease-out) backwards;
}

.port-report-note-field {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.port-report-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.port-report-note-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.port-report-note-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-muted);
}

.port-report-note-count.is-near-limit {
  color: var(--gold);
}

.port-report-note-count.is-at-limit {
  color: var(--error-text);
  font-weight: 700;
}

.port-report-note-input {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--text-strong);
  font-size: 12px;
  line-height: 1.4;
  resize: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.port-report-note-input::placeholder {
  color: var(--text-muted);
}

.port-report-note-input:focus {
  outline: none;
  border-color: var(--accent);
}

.port-report-note-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.port-empty {
  grid-column: 1 / -1;
  color: var(--text-secondary);
}

/* Port Ratings & Popover */
.port-rating {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.port-rating-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 28px;
  padding: 2px 5px;
  margin: -2px -5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.port-rating-summary:hover {
  background: var(--surface-2);
}

.port-rating-summary:active {
  transform: scale(0.96);
}

.port-rating-stars {
  display: inline-flex;
  color: var(--gold);
  font-size: 16px;
  white-space: nowrap;
}

.port-rating-star {
  position: relative;
  display: inline-block;
  color: var(--border-medium);
  transform-origin: center center;
  will-change: transform;
  transition: transform var(--duration-fast) var(--ease-out);
}

.port-rating-summary:hover .port-rating-star {
  transform: scale(1.06);
}

.port-rating-stars.is-animating .port-rating-star {
  animation: napl-star-pop 340ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
  animation-delay: calc(var(--star-index, 0) * 38ms);
}

.port-rating-star-fill {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  color: var(--gold);
  white-space: nowrap;
}

.port-rating-average {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
}

.port-rating-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.port-rating-trigger {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.port-rating-trigger.is-open::after {
  content: "";
  position: absolute;
  z-index: 22;
  top: calc(100% + 5px);
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--surface-2);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
}

.port-rating-button {
  min-height: 36px;
  border: 1px solid #4ade80;
  background: #16a34a;
  color: #ffffff;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.port-rating-button:hover {
  background: #22c55e;
  border-color: #86efac;
  color: #052e16;
}

.port-rating-button:active {
  transform: scale(0.96);
}

.port-rating-popover {
  position: absolute;
  z-index: 21;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  max-width: min(260px, calc(100vw - 44px));
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-popover);
  transform-origin: top right;
}

.port-rating-popover:not([hidden]) {
  animation: napl-popover-down 170ms var(--ease-out) backwards;
}

.port-rating-popover-title {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.port-rating-popover-description {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.port-rating-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--text-strong);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.port-rating-option:hover,
.port-rating-option.selected {
  border-color: var(--gold);
  background: var(--surface-3);
}

.port-rating-option:active:not(:disabled) {
  transform: scale(0.98);
}

.port-rating-option.is-animating {
  animation: napl-rating-option-pulse 260ms var(--ease-out) both;
}

.port-rating-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.port-rating-option-stars {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  color: var(--gold);
}

.port-rating-option-star {
  display: inline-block;
  transform-origin: center center;
  will-change: transform;
  transition:
    transform var(--duration-fast) var(--ease-out),
    filter var(--duration-fast) var(--ease-out);
}

.port-rating-option:hover .port-rating-option-star,
.port-rating-option.selected .port-rating-option-star {
  filter: drop-shadow(0 0 4px rgba(245, 196, 81, 0.35));
}

.port-rating-option.is-animating .port-rating-option-star {
  animation: napl-star-pop 340ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
  animation-delay: calc(var(--star-index, 0) * 34ms);
}

@keyframes napl-star-pop {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(245, 196, 81, 0));
  }
  42% {
    transform: scale(1.38) translateY(-2px) rotate(-6deg);
    filter: drop-shadow(0 0 7px rgba(245, 196, 81, 0.65));
  }
  72% {
    transform: scale(0.94) translateY(0) rotate(2deg);
  }
  100% {
    transform: scale(1) translateY(0) rotate(0deg);
    filter: drop-shadow(0 0 2px rgba(245, 196, 81, 0.25));
  }
}

@keyframes napl-rating-option-pulse {
  0% {
    transform: scale(0.98);
  }
  50% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .port-rating-stars.is-animating .port-rating-star,
  .port-rating-option.is-animating,
  .port-rating-option.is-animating .port-rating-option-star {
    animation: none !important;
  }

  .port-rating-summary:active,
  .port-rating-button:active,
  .port-rating-option:active:not(:disabled) {
    transform: none;
  }
}

.port-rating-submit {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 11px;
  padding: 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--cta-bg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.port-rating-submit:hover:not(:disabled) {
  background: var(--cta-hover);
}

.port-rating-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.port-rating-feedback {
  margin: 9px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.port-rating-feedback.error {
  color: var(--error-text);
}

.port-rating-feedback.success {
  color: var(--accent);
}

/* Integrated Port Compatibility Telemetry Sub-Panel */
.port-compat-separator {
  margin: 14px 0 12px;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
}

.port-compat {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.port-compat-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.port-compat-main {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.port-compat-summary-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

.port-compat-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.port-compat-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.port-compat-summary.is-empty {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
}

.port-compat-meter {
  display: flex;
  width: 100%;
  height: 8px;
  margin-top: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
}

.port-compat-meter.is-empty {
  position: relative;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    rgba(255, 255, 255, 0.05) 6px 12px
  );
  border: 1px dashed var(--border-medium);
}


html[data-theme="light"] .port-compat-meter.is-empty {
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    rgba(17, 34, 27, 0.06) 6px 12px
  );
}



.port-compat-meter-segment {
  height: 100%;
  width: 0%;
}

.port-compat-meter-segment.is-playable-60 {
  background: #16a34a;
}

.port-compat-meter-segment.is-playable-30 {
  background: #86efac;
}

.port-compat-meter-segment.is-low-fps {
  background: #facc15;
}

.port-compat-meter-segment.is-crash {
  background: #ef4444;
}

html[data-theme="light"] .port-compat-meter-segment.is-playable-60 {
  background: #15803d;
}

html[data-theme="light"] .port-compat-meter-segment.is-playable-30 {
  background: #4ade80;
}

html[data-theme="light"] .port-compat-meter-segment.is-low-fps {
  background: #eab308;
}

html[data-theme="light"] .port-compat-meter-segment.is-crash {
  background: #dc2626;
}

.port-compat-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.port-compat-toggle {
  min-height: 34px;
  border: 1px solid var(--border-medium);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.port-compat-toggle:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.port-compat-toggle:active {
  transform: scale(0.96);
}

.port-compat-button {
  min-height: 34px;
  border: 1px solid #4ade80;
  background: #16a34a;
  color: #ffffff;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.port-compat-button:hover {
  background: #22c55e;
  border-color: #86efac;
  color: #052e16;
}

.port-compat-button:active {
  transform: scale(0.96);
}

.port-compat-trigger {
  position: relative;
  display: inline-flex;
}

.port-compat-popover {
  position: absolute;
  z-index: 25;
  top: calc(100% + 10px);
  right: 0;
  width: 316px;
  max-width: min(316px, calc(100vw - 44px));
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-popover);
  transform-origin: top right;
}

.port-compat-popover:not([hidden]) {
  animation: napl-popover-down 170ms var(--ease-out) backwards;
}

.port-compat-tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.port-compat-choice {
  min-height: 40px;
  padding: 8px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.port-compat-choice:hover {
  background: var(--surface-3);
}

.port-compat-choice.selected.is-playable-60 {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
}

html[data-theme="light"] .port-compat-choice.selected.is-playable-60 {
  border-color: #15803d;
  background: rgba(21, 128, 61, 0.14);
  color: #15803d;
}

.port-compat-choice.selected.is-playable-30 {
  border-color: #86efac;
  background: rgba(134, 239, 172, 0.14);
  color: #86efac;
}

html[data-theme="light"] .port-compat-choice.selected.is-playable-30 {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.18);
  color: #16a34a;
}

.port-compat-choice.selected.is-low-fps {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.16);
  color: #facc15;
}

html[data-theme="light"] .port-compat-choice.selected.is-low-fps {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}

.port-compat-choice.selected.is-crash {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

html[data-theme="light"] .port-compat-choice.selected.is-crash {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.port-device-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.port-device-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.port-device-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--text-strong);
  font-size: 12px;
}

.port-device-input:focus {
  outline: none;
  border-color: var(--accent);
}

.port-device-results {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-medium);
  border-radius: 7px;
  background: var(--surface-1);
}

.port-device-results:not([hidden]) {
  animation: napl-game-enter 160ms var(--ease-out) backwards;
}

.port-device-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-strong);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.port-device-option:last-child {
  border-bottom: 0;
}

.port-device-option:hover {
  background: var(--surface-3);
  color: var(--accent);
}

.port-device-name {
  font-weight: 600;
  line-height: 1.3;
}

.port-device-soc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.port-device-option:hover .port-device-soc {
  color: var(--text-secondary);
}

.port-device-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.port-device-selected {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.port-compat-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.port-compat-list:not([hidden]) {
  animation: napl-game-enter 180ms var(--ease-out) backwards;
}

@keyframes napl-game-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes napl-popover-down {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes napl-popover-up {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes napl-copy-pop {
  0% {
    transform: scale(0.94);
  }
  55% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-summary-card.is-entering,
  .game-hero.is-entering,
  .port-card.is-entering,
  .game-share-popover:not([hidden]),
  .port-rating-popover:not([hidden]),
  .port-compat-popover:not([hidden]),
  .port-report-link-popover:not([hidden]),
  .port-device-results:not([hidden]),
  .port-compat-list:not([hidden]),
  .game-share-copy-btn.is-copied {
    animation: none !important;
  }

  .game-share-button:active,
  .game-share-copy-btn:active,
  .port-compat-toggle:active,
  .port-compat-button:active,
  .port-report-link-button:active {
    transform: none;
  }
}

.port-compat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.port-compat-device-wrap {
  min-width: 0;
  overflow-wrap: anywhere;
}

.port-compat-device {
  color: var(--text-main);
}

.port-compat-soc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.port-compat-status {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.port-compat-status.is-playable-60 {
  color: #22c55e;
}

html[data-theme="light"] .port-compat-status.is-playable-60 {
  color: #15803d;
}

.port-compat-status.is-playable-30 {
  color: #86efac;
}

html[data-theme="light"] .port-compat-status.is-playable-30 {
  color: #16a34a;
}

.port-compat-status.is-low-fps {
  color: #facc15;
}

html[data-theme="light"] .port-compat-status.is-low-fps {
  color: #a16207;
}

.port-compat-status.is-crash {
  color: #f87171;
}

html[data-theme="light"] .port-compat-status.is-crash {
  color: #dc2626;
}

@media (max-width: 780px) {
  #port-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .game-summary-card,
  .game-hero {
    gap: 16px;
    padding: 18px;
    margin-bottom: 22px;
  }

  .game-summary-top {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "cover header"
      "body body";
    gap: 14px 16px;
  }

  .game-hero-media {
    width: 96px;
  }

  .game-summary-head {
    margin-bottom: 6px;
  }

  .port-card {
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .port-details {
    gap: 7px 10px;
  }
}

@media (max-width: 480px) {

  .port-rating {
    gap: 5px;
  }

  .port-rating-summary {
    gap: 4px;
  }

  .port-rating-stars {
    font-size: 14px;
  }

  .port-rating-average {
    font-size: 12px;
  }

  .port-rating-count {
    font-size: 10px;
  }

  .port-rating-button,
  .port-compat-button,
  .port-compat-toggle {
    min-height: 40px;
  }

  .game-share-button {
    width: 40px;
    height: 40px;
  }

  .game-share-popover {
    width: 292px;
    max-width: calc(100vw - 48px);
  }

  .port-rating-button {
    padding: 6px 10px;
  }

  .port-rating-popover {
    width: 250px;
  }
}
