/* Shared styles for the public pages (index, account, profile, tos, privacy,
   jumpingchicken, 404). admin.html and dev.html keep their own CSS. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: #35066a;
}

/* Fixed layer rather than background-attachment, which iOS Safari ignores */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #000000, #6a0dad);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  min-height: 100vh;
  padding: 0 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.5;
}

main {
  width: 100%;
  max-width: 700px;
  flex: 1;
}

h1 {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 10px;
}

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

p {
  color: #ccc;
}

a {
  color: #d0aaff;
}

a:hover {
  color: white;
}

:focus-visible {
  outline: 2px solid #d0aaff;
  outline-offset: 2px;
}

/* Top bar */
nav {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 65px;
  padding: 14px 0;
  margin-bottom: 30px;
}

nav .brand {
  margin-right: auto;
  font-weight: bold;
  font-size: 1.1rem;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links a, .nav-links button {
  color: white;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.nav-links a:hover, .nav-links button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#user-name {
  color: #ccc;
  font-size: 0.95rem;
}

/* Page heading */
header {
  text-align: center;
  margin-bottom: 36px;
  width: 100%;
  max-width: 700px;
}

header p {
  font-size: 1.15rem;
}

header p + p {
  margin-top: 6px;
  font-size: 1rem;
}

/* Boxes */
.card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  padding: 28px 30px;
  margin-bottom: 24px;
}

/* Buttons */
.button, .card button {
  display: inline-block;
  padding: 10px 18px;
  background-color: #6a0dad;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  color: white;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button:hover, .card button:hover {
  background-color: #8f3eea;
  color: white;
}

.button.outline, .card button.outline {
  background-color: transparent;
}

.button.outline:hover, .card button.outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.card button.danger {
  background-color: transparent;
  border-color: #ff6347;
  color: #ff8a73;
}

.card button.danger:hover {
  background-color: rgba(255, 99, 71, 0.15);
}

.card button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Forms */
input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  font: inherit;
}

input::placeholder {
  color: #999;
}

.auth-form {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.auth-form input {
  margin-bottom: 12px;
}

.auth-form button {
  width: 100%;
  margin-top: 4px;
}

.form-message {
  margin-top: 10px;
  color: #ff6347;
}

.form-message:empty {
  display: none;
}

.form-message.ok {
  color: #7CFC00;
}

/* Boxes on the home page */
#game, #developers {
  text-align: center;
}

.card .links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 10px;
}

.note {
  font-size: 0.9rem;
  color: #aaa;
}

#suspended-message {
  border-color: #ff6347;
  background: rgba(255, 99, 71, 0.1);
  text-align: center;
}

#suspended-message h2 {
  color: #ff6347;
}

#suspended-message p + p {
  margin-top: 8px;
}

/* Key/value rows on account and profile */
.rows {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px 16px;
  align-items: baseline;
}

.rows dt {
  color: #aaa;
}

.rows dd {
  overflow-wrap: anywhere;
}

.rows dd.small {
  font-size: 0.85rem;
  color: #ccc;
}

#message {
  margin-bottom: 16px;
}

.good {
  color: #7CFC00;
}

.bad {
  color: #ff6347;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.card button.link-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  color: #d0aaff;
  font-size: 0.9rem;
  text-decoration: underline;
}

.card button.link-button:hover {
  background: none;
  color: white;
}

/* Friends */
.friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.friend-item:last-child {
  border-bottom: none;
}

.friend-item a {
  overflow-wrap: anywhere;
}

.friend-item button {
  padding: 5px 12px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.add-friend {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.add-friend button {
  flex-shrink: 0;
}

/* Profile */
.profile-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #6a0dad;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

.profile-top h1 {
  font-size: 1.9rem;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.tag {
  font-size: 0.85rem;
  color: #7CFC00;
}

#bioEl {
  margin-top: 16px;
}

.stats {
  display: flex;
  gap: 40px;
}

.stats + .xp-label {
  margin-top: 18px;
}

.stats strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.2;
}

.stats span {
  color: #aaa;
}

.xp-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  color: #ccc;
  margin-bottom: 6px;
}

.xp-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background-color: #8f3eea;
  transition: width 0.4s ease;
}

/* Terms and privacy */
main.doc {
  max-width: 800px;
}

.doc h2 {
  margin-top: 30px;
  margin-bottom: 8px;
}

.doc h2:first-child {
  margin-top: 0;
}

.doc p {
  margin-bottom: 12px;
}

.doc ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.doc li {
  margin-bottom: 6px;
  color: #ccc;
}

/* Jumping Chicken */
.game-logo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 10px;
  image-rendering: pixelated;
}

.screenshot-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.screenshot-gallery a {
  flex: 1 1 180px;
  max-width: 200px;
}

.screenshot-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 200 / 258;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #444;
}

.center {
  text-align: center;
}

/* Footer */
footer {
  margin-top: 30px;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
}

footer p {
  color: #aaa;
}

footer a {
  color: #ccc;
  margin: 0 6px;
  text-decoration: none;
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

@media (max-width: 600px) {
  body {
    padding: 0 14px 24px;
  }

  nav {
    margin-bottom: 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .card {
    padding: 20px;
  }

  .card .links .button {
    width: 100%;
  }

  .rows {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rows dd {
    margin-bottom: 10px;
  }

  .add-friend {
    flex-direction: column;
  }
}
