body {
  background-color: #141414;
  color: white;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #000;
  padding: 20px;
  text-align: center;
  /* Custom background support */
  transition: background 0.3s ease;
}

#catalog-header {
  margin: 0;
  padding: 35px 20px; /* Increased vertical padding to make it taller */
  width: 100%;
  box-sizing: border-box;
  border: none !important; /* Ensure no border */
  outline: none !important; /* Remove any outline */
  box-shadow: none !important; /* Remove any shadow that might look like a border */
  border-radius: 0;
  background-color: transparent !important; /* Override generic header background */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

#header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#header-content h1,
#header-content #app-name {
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

#edition-switcher {
  position: relative;
  z-index: 1;
}

main {
  padding: 20px;
}

section {
  margin-bottom: 40px;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.row {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 10px;
}

.row::-webkit-scrollbar {
  height: 8px;
}

.row::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 4px;
}

.card {
  width: 260px; /* Fixed width for uniform sizing */
  min-width: 260px; /* Ensure minimum width */
  height: 371px; /* Fixed height for uniformity */
  background-color: #333;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  text-align: center;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

.card-controls {
  margin-top: auto; /* Push controls to the bottom */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
}

.card h3 {
  margin: 10px 0;
  font-size: 18px;
}

.card-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.card:hover {
  transform: scale(1.05);
}

.card .placeholder {
  width: 100%;
  padding-bottom: 61.8%; /* Golden ratio: 100% / 1.618 ≈ 61.8% */
  background-color: #555;
  margin-bottom: 10px;
  font-size: 14px;
  color: #aaa;
  position: relative;
  overflow: hidden;
}

/* Poster images and content wrappers */
.card .placeholder .poster-image,
.card .placeholder .poster-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

/* Flexbox for text content */
.card .placeholder .poster-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card h3 {
  margin: 10px 0;
  font-size: 18px;
}

.card p {
  font-size: 14px;
  margin-bottom: 10px;
}

.card button, .card a {
  background-color: #e50914;
  color: white;
  border: none;
  padding: 8px 16px;
  margin: 5px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.card button:hover, .card a:hover {
  background-color: #f40612;
}

.card button:disabled {
  background-color: #666;
  cursor: not-allowed;
}

.card-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* Live Mode Styles */
.card.running {
  border: 2px solid #e50914;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.card.running .placeholder {
  background-color: #2c2c2c;
  border-bottom: 2px solid #e50914;
}

.card.running h3 {
  color: #e50914;
}

#app-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #141414;
  z-index: 2000;
}

#app-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#back-btn {
  position: static !important;
  margin-right: 20px;
}

/* Responsive adjustments for live mode */
@media (max-width: 768px) {
  #header-content {
    flex-direction: column;
    gap: 10px;
  }

  #back-btn {
    margin-right: 0;
    margin-bottom: 10px;
  }

  #keyboard-hint {
    margin-left: 0 !important;
    margin-right: 0 !important;
    font-size: 12px;
  }
}