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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0d0e15;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: linear-gradient(135deg, #161824, #1e2130);
  border-bottom: 2px solid #2e8bff;
  position: relative;
}

/* Account button — top-right corner, up and across from the title */
.account {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid #2e8bff;
  border-radius: 999px;
  background: rgba(46, 139, 255, 0.12);
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

.account-btn:hover { background: #2e8bff; transform: translateY(-1px); }
.account-btn:active { transform: translateY(0); }

.account-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }

.account-logout {
  border: none;
  background: none;
  color: #8fa6c9;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.3rem;
  text-decoration: underline;
}

.account-logout:hover { color: #2e8bff; }

@media (max-width: 480px) {
  .account { top: 0.6rem; right: 0.6rem; }
  .account-btn { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
  .account-name { max-width: 6rem; }
}

header h1 {
  font-size: 2.5rem;
  color: #2e8bff;
  letter-spacing: 0.05em;
}

.site-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.site-title .axolotl {
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(46, 139, 255, 0.85)) drop-shadow(0 0 14px rgba(46, 139, 255, 0.45));
  animation: axolotlGlow 2.8s ease-in-out infinite;
}

@keyframes axolotlGlow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(46, 139, 255, 0.7)) drop-shadow(0 0 12px rgba(46, 139, 255, 0.35)); }
  50%      { filter: drop-shadow(0 0 9px rgba(46, 139, 255, 0.95)) drop-shadow(0 0 20px rgba(46, 139, 255, 0.6)); }
}

/* ── Live "who's online" count, under the left axolotl ──────────────────────
   The axolotl and the count share one column slot so the count sits directly
   beneath it. The pill is hidden with `visibility`, not `display`, so its space
   is reserved from first paint — the header never jumps when the number
   arrives (or never arrives, on a network that blocks WebSockets). */
.site-title .lotl-slot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.online-count {
  visibility: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font: 600 0.72rem/1 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.04em;
  color: #7cc0ff;
  background: rgba(46, 139, 255, 0.12);
  border: 1px solid rgba(46, 139, 255, 0.45);
  border-radius: 999px;
  padding: 0.32em 0.65em;
  white-space: nowrap;
}

.online-count.on { visibility: visible; }

.online-count .online-n {
  color: #fff;
  font-weight: 700;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5dd39e;
  box-shadow: 0 0 6px rgba(93, 211, 158, 0.9);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.75); }
}

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

/* Hidden entrance to the dev console — looks like the rest of the logo */
.site-title .secret-door {
  display: inline-flex;
  line-height: 0;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

/* Same door, now hidden in the word "code" in the Fun Code intro. It has to
   inherit everything from the surrounding sentence — colour, weight, cursor,
   no underline — or it reads as a link and stops being hidden. */
.fun-intro .secret-door {
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: text;
  -webkit-tap-highlight-color: transparent;
}
.fun-intro .secret-door:hover,
.fun-intro .secret-door:focus,
.fun-intro .secret-door:visited {
  color: inherit;
  text-decoration: none;
  outline: none;
}

.tagline {
  color: #aaa;
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.update-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #2e8bff;
  background: rgba(46, 139, 255, 0.14);
  color: #7cc0ff;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(46, 139, 255, 0.45);
  animation: badgePulse 2.2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(46, 139, 255, 0.35); }
  50%      { box-shadow: 0 0 14px rgba(46, 139, 255, 0.7); }
}

main {
  flex: 1;
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

section {
  background: #161824;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #1e2130;
}

section h2 {
  font-size: 1.2rem;
  color: #2e8bff;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Tamagotchi */
.tamagotchi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.screen {
  background: #0a0b11;
  border: 3px solid #ff2e7e;
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 0 20px rgba(255, 46, 126, 0.3);
  position: relative;
}

.pet-display {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.pet {
  font-size: 4rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0e15;
  border-radius: 12px;
  border: 1px solid #1e2130;
  flex-shrink: 0;
  transition: transform 0.1s;
}

.pet.bounce {
  animation: bounce 0.3s ease;
}

@keyframes bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25) rotate(-5deg); }
  70%  { transform: scale(0.9) rotate(3deg); }
  100% { transform: scale(1); }
}

.status-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-bars label {
  font-size: 0.72rem;
  color: #aaa;
  display: flex;
  justify-content: space-between;
}

.bar {
  height: 8px;
  background: #1e2130;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #ff2e7e;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.speech-bubble {
  background: #1e2130;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  color: #ccc;
  min-height: 2rem;
  text-align: center;
  transition: opacity 0.3s;
}

.age-display {
  font-size: 0.72rem;
  color: #555;
  text-align: right;
  margin-top: 0.5rem;
}

.buttons {
  display: flex;
  gap: 0.6rem;
}

.buttons button {
  flex: 1;
  padding: 0.6rem 0.4rem;
  border: none;
  border-radius: 8px;
  background: #1e2130;
  color: #eee;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.buttons button:hover {
  background: #ff2e7e;
  transform: scale(1.05);
}

.buttons button:active {
  transform: scale(0.97);
}

/* Game hub cards */
.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: #1e2130;
  border-radius: 10px;
  border: 1px solid #2c3040;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, transform 0.15s;
}

.game-card:hover {
  background: #2e8bff;
  transform: translateY(-3px);
  box-shadow: 0 0 14px rgba(46, 139, 255, 0.6), 0 0 28px rgba(46, 139, 255, 0.4);
  border-color: #7cc0ff;
}

.game-card:hover .game-desc { color: rgba(255,255,255,0.85); }

.game-icon { font-size: 2.8rem; }
.game-name { font-size: 1rem; font-weight: bold; color: #eee; }
.game-desc { font-size: 0.78rem; color: #888; text-align: center; }

/* Mod cards (photo instead of emoji) */
.mod-card { justify-content: flex-start; }

.mod-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #0d0e15;
}

/* Mod detail page */
.mod-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.mod-hero {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #ff2e7e;
  background: #0d0e15;
}

.mod-title {
  color: #eee;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}

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

.mod-details {
  width: 100%;
  color: #bbb;
  line-height: 1.6;
}

.download-btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background: #ff2e7e;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 8px;
  transition: background 0.2s, transform 0.1s;
}

.download-btn:hover { background: #ff5c9c; transform: scale(1.05); }
.download-btn:active { transform: scale(0.97); }

.back-link {
  color: #888;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { color: #ff2e7e; }

/* Online Games */
.online-games .coming-soon {
  color: #888;
  font-style: italic;
  line-height: 1.6;
}

/* Fun Code — instructions up top, then a grid of copy-me code cards */
.fun-code .fun-intro {
  color: #bbb;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.fun-code .fun-intro strong { color: #eee; }

.fun-code .kbd {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  background: #0a0b11;
  border: 1px solid #2e8bff;
  border-radius: 5px;
  color: #7cc0ff;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

/* Fun Code cards are <button>s — strip the default button look so they
   match the game/mod cards, then keep the shared .game-card styles. */
.fun-card {
  font: inherit;
  text-align: center;
  cursor: pointer;
  width: 100%;
}

.fun-card.copied {
  background: #5dd39e;
  border-color: #5dd39e;
  transform: translateY(-3px);
}

.fun-card.copied .game-name { color: #0a0b11; }
.fun-card.copied .game-desc { color: rgba(10,11,17,0.7); }

/* Recommendations */
.recommendations p {
  color: #bbb;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* About */
.about p {
  color: #bbb;
  line-height: 1.6;
}

footer {
  text-align: center;
  padding: 1rem;
  color: #444;
  font-size: 0.8rem;
}

/* Vertical "A-lotl Vids" banner down the left edge */
.vids-banner {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.55rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: linear-gradient(180deg, #ff2e7e, #c44d8a);
  color: #fff;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 0 12px 12px 0;
  box-shadow: 2px 2px 14px rgba(0, 0, 0, 0.4);
  transition: padding-left 0.2s, background 0.2s;
}

.vids-banner:hover {
  padding-left: 0.9rem;
  background: linear-gradient(180deg, #ff5c9c, #d75a9c);
}

.vids-banner .vids-emoji {
  writing-mode: horizontal-tb;
  font-size: 1.3rem;
}

@media (max-width: 640px) {
  .vids-banner { font-size: 0.8rem; padding: 0.7rem 0.4rem; }
  .vids-banner .vids-emoji { font-size: 1.1rem; }
}
