* {
  box-sizing: border-box;
}

:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background: #071f46;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.12), transparent 34rem),
    linear-gradient(160deg, #0a2d63, #04152f);
}

.page-shell {
  width: min(100%, 920px);
  margin: auto;
  padding: 32px 18px 20px;
}

.card {
  text-align: center;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 28px;
  background: rgba(3, 18, 42, 0.72);
  box-shadow: 0 24px 70px rgba(0,0,0,0.30);
  backdrop-filter: blur(6px);
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 0.78rem;
  opacity: 0.78;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.5rem);
  line-height: 0.98;
}

.intro {
  max-width: 620px;
  margin: 18px auto 28px;
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  line-height: 1.55;
  color: rgba(255,255,255,0.84);
}

.hat-stage {
  width: min(100%, 600px);
  aspect-ratio: 10 / 7;
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(0,0,0,0.32);
}

.hat-welcome {
margin: 0;
padding: 24px;
color: #071f46;
font-size: clamp(2rem, 7vw, 3.8rem);
font-weight: 900;
line-height: 1.1;
text-align: center;
}

.hat-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hat-stage img.changing {
  animation: hatChange 420ms ease;
}

@keyframes hatChange {
  0% { opacity: 0; transform: scale(0.88) rotate(-3deg); }
  70% { opacity: 1; transform: scale(1.03) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.hat-message {
  min-height: 1.6em;
  margin: 22px 0 14px;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
}

.generate-button {
  border: 0;
  border-radius: 999px;
  padding: 16px 26px;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  color: #071f46;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.generate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
}

.generate-button:active {
  transform: translateY(1px) scale(0.98);
}

.generate-button:focus-visible {
  outline: 4px solid #ffd75e;
  outline-offset: 4px;
}

.small-note {
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.62);
}

footer {
  padding: 18px;
  text-align: center;
  color: rgba(255,255,255,0.58);
  font-size: 0.86rem;
}

@media (max-width: 520px) {
  .page-shell {
    padding-top: 16px;
  }

  .card {
    border-radius: 20px;
    padding: 24px 16px 30px;
  }

  .hat-stage {
    border-radius: 18px;
  }

  .generate-button {
    width: 100%;
  }
}

.number8man-logo {
display: block;
width: min(180px, 45vw);
height: auto;
margin: 0 auto 18px;
object-fit: contain;
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


.hat-stage {
min-height: 320px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
text-align: center;
}

#hatImage {
display: block;
width: auto;
height: auto;
max-width: 95%;
max-height: 300px;
object-fit: contain;
margin-left: auto;
margin-right: auto;
position: static;
transform: translateX(-15px);
}

.adventure-image {
display: block;
width: 100%;
max-width: 430px;
height: auto;
margin: 0 auto;
object-fit: contain;
}


/* ======================================================
   NUMBER8MAN v1.6 — HOME PAGE
   ====================================================== */
.home-card {
  max-width: 860px;
  margin: 0 auto;
}

.home-number8man {
  display: block;
  width: min(100%, 520px);
  max-height: 470px;
  object-fit: contain;
  margin: 34px auto 38px;
}

.home-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.home-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 18px 20px;
  border: 2px solid rgba(255,255,255,0.78);
  border-radius: 18px;
  color: #071f46;
  background: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 900;
  font-size: clamp(1rem, 2.4vw, 1.22rem);
  letter-spacing: 0.035em;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.home-tab:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 36px rgba(0,0,0,0.32);
}

.home-tab:active {
  transform: translateY(1px) scale(0.99);
}

.home-tab:focus-visible {
  outline: 4px solid #ffd75e;
  outline-offset: 4px;
}

@media (max-width: 650px) {
  .home-nav {
    grid-template-columns: 1fr;
  }

  .home-number8man {
    margin: 26px auto 30px;
  }
}
