:root {
  --font-primary: "Helvetica Neue", Arial, sans-serif;
  --text-color: #000;
}

@media (max-width: 720px) {
  .main {
    flex-direction: row;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .character img {
    width: clamp(84px, 25vw, 196px);
  }
  .header nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .nav-link {
    display: block;
  }
}

@media (max-width: 1024px), (prefers-reduced-motion: reduce) {
  body { background-attachment: scroll; }
}

/* keep baseline as-is */
.chapter-image {
  display: block;
  width: 40%;
  height: auto;
  margin: 0 auto 1rem;
}
@media (max-width: 720px) {
  .chapter-image {
    width: 100%;
    height: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-primary);
  color: var(--text-color);
  overflow: auto;
  overflow-x: hidden;
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2980b9;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 0;
}

a,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

/* Improved focus states for accessibility */
a:focus,
button:focus,
textarea:focus {
  outline: 2px solid #2980b9;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Hover effects */
a:hover,
button:hover {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

.header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.header__logo {
  margin-bottom: 1rem;
}

.header__logo-img {
  width: clamp(80px, 15vw, 120px);
  height: auto;
  display: block;
  margin: 0 auto;
  background: transparent;
  mix-blend-mode: multiply;
}

/* Special styles for logo on character pages */
.header__logo-img--character {
  filter: invert(1) brightness(1.2);
  mix-blend-mode: normal;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
}
.header__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.header__subtitle {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-style: italic;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 1rem;
  gap: 1rem;
}

.character {
  flex: 0 0 auto;
  text-align: center;
  margin: 0;
}
.character img {
  width: clamp(84px, 17.5vw, 196px);
  height: auto;
}
.character__label {
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Shared styles for all logos */
.logo,
.games-logo,
.book-logo,
.character-logo,
.manifest-logo {
  width: clamp(100px, 20vw, 160px);
  height: auto;
  display: block;
}

.logo {
  flex: 0 0 auto;
}

.logo-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.nav-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  color: inherit;
}

.nav-link--play:visited {
  color: #e74c3c;
}

.slogan {
  text-align: center;
  font-size: 1.25rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* Manifest page */
.manifest-page {
  align-items: center;
  justify-content: center;
}
.manifest-content {
  text-align: center;
  padding: 2rem;
  margin-bottom: 2rem;
}
.manifest-logo {
  margin-bottom: 2rem;
}
.manifest-text {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.6;
  font-size: 1rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 700;
  color: inherit;
}

.site-footer {
  text-align: center;
  margin-top: auto;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: inherit;
}

/* Games page - Amazon style */
.games-page {
  background: #f5f5f5;
  min-height: 100vh;
}

.games-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.games-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #333;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.game-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.game-card.available {
  border-left: 4px solid #28a745;
}

.game-card.coming-soon {
  border-left: 4px solid #ffc107;
}

.game-image {
  text-align: center;
  margin-bottom: 1rem;
}

.game-image img {
  width: clamp(80px, 15vw, 120px);
  height: auto;
  border-radius: 4px;
}

.game-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #333;
  text-align: center;
}

.game-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stars {
  color: #ff9500;
  font-size: 1rem;
}

.rating-text {
  font-size: 0.9rem;
  color: #666;
}

.game-description {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #555;
  margin-bottom: 1rem;
  text-align: left;
}

.game-price {
  margin-bottom: 0.5rem;
  text-align: center;
}

.price-label {
  font-size: 0.9rem;
  color: #666;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e74c3c;
  margin-left: 0.5rem;
}

.game-status {
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.available-status {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.coming-soon-status {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.game-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.game-button.primary {
  background: #ff9500;
  color: white;
}

.game-button.primary:hover {
  background: #e6850e;
  transform: translateY(-1px);
}

.game-button.secondary {
  background: #f0f0f0;
  color: #666;
  cursor: not-allowed;
}

.game-button.secondary:disabled {
  opacity: 0.6;
}

.additional-links {
  text-align: center;
  margin-bottom: 2rem;
}

.channel-link {
  display: inline-block;
  padding: 1rem 2rem;
  background: #0088cc;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.channel-link:hover {
  background: #006bb3;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 2rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: 2px solid #333;
  border-radius: 6px;
  width: fit-content;
  margin: 2rem auto 0;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: #333;
  color: white;
}

/* Responsive design */
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .games-content {
    padding: 1rem;
  }
  
  .games-title {
    font-size: 1.5rem;
  }
}

/* Book page */
.book-page {
  align-items: center;
  justify-content: center;
}

.book-content {
  text-align: center;
  padding: 2rem;
}

.book-logo {
  margin-bottom: 2rem;
}

.toc {
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  font-size: 1rem;
  text-align: left;
}

.toc h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.toc a {
  color: inherit;
}

/* Restrict chapter text width so images align with paragraph width */
.chapter {
  max-width: 40rem;
  margin: 0 auto 2rem;
  padding: 1rem;
  line-height: 1.8;
  font-size: 1.1rem;
  text-align: justify;
  white-space: pre-line;
}

.chapter h3 {
  text-align: center;
  margin-bottom: 1rem;
}

/* Subscription form styles - Minimalist */
.subscription-section {
  margin: 2rem auto;
  max-width: 400px;
  text-align: center;
  padding: 1rem;
}

.subscription-section p {
  color: #666;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 400;
}

.subscription-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.subscription-form input {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.subscription-form input:focus {
  outline: none;
  border-color: #333;
}

.subscribe-button {
  background: #333;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.subscribe-button:hover {
  background: #000;
}

.subscribe-button:disabled {
  background: #999;
  cursor: not-allowed;
}

.subscription-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.subscription-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.subscription-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive design for subscription form */
@media (max-width: 768px) {
  .subscription-section {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .subscription-section h3 {
    font-size: 1.2rem;
  }
}

/* Character detail pages */
.character-page {
  background: #000;
  color: #fff;
  align-items: center;
  justify-content: center;
}

.character-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.character-logo {
  margin-bottom: 2rem;
}

.character-image {
  width: clamp(84px, 17.5vw, 196px);
  height: auto;
  margin-bottom: 2rem;
}

.character-quote {
  font-style: italic;
  margin: 0 auto 2rem;
  max-width: 40rem;
  line-height: 1.6;
}

/* Index page spacing adjustments */
body.index-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
}

.index-page .header {
  padding-bottom: 0;
}


.index-page .main {
  flex-grow: 0;
  padding-top: 0;
  padding-bottom: 0;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.index-page .slogan {
  margin: 0;
}

.index-page .site-footer {
  margin-top: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.index-page .site-footer p {
  margin: 0;
}

.index-page .site-footer p + p {
  margin-top: 0.5rem;
}

/* Chat interface */
.software-page {
  background: #ffffff;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.message {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.message.neiv {
  flex-direction: row;
}

.message.trisha {
  flex-direction: row-reverse;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.bubble {
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  max-width: 70%;
}

.message.neiv .bubble {
  background: #e6e6e6;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  padding: 0.5rem;
}

.chat-input button {
  padding: 0.5rem 1rem;
}