/* Lobby / shared site chrome: topbar, footer, hero, landing sections,
   room list, join dialogs. Depends on base.css + components.css. */

/* ---- Topbar ----
   Read as the forehead protector: a dark cloth band carrying a steel plate with
   the leaf struck into it. The band is the nav; the plate is the brand. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(160%);
}
/* The stitched edge of the cloth. */
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--grad-leaf);
  opacity: 0.55;
}
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.14rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.brand b { color: var(--orange-hot); }

/* The brand mark is the leaf on its own.
   It was briefly struck into a brushed-steel headband plate. The reference is
   right but the object is not: at 40x28 on a page that is otherwise flat, the
   plate reads as a grey UI chip rather than as metal — and on the light theme
   it sits on washi as a hard grey box with nothing else on the page to explain
   it. The leaf carries the village on its own. */
.brand-leaf {
  flex: none;
  width: 26px;
  height: 26px;
  background: var(--leaf-bright);
  -webkit-mask: var(--leaf-mark) no-repeat center / contain;
          mask: var(--leaf-mark) no-repeat center / contain;
  transition: background-color 0.18s ease;
}
.brand:hover .brand-leaf { background: var(--orange-hot); }

.top-nav { display: flex; gap: 2px; }
.top-nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none !important;
  transition: color 0.14s ease, background-color 0.14s ease;
}
.top-nav-link:hover { color: var(--text); background: var(--panel-hover); }
/* Green marks WHERE YOU ARE; orange is reserved for what you can press. */
.top-nav-link.is-active { color: var(--leaf-bright); }
.top-nav-link.is-active::after {
  content: '';
  display: block;
  height: 2px;
  margin: 5px -4px -6px;
  border-radius: 2px;
  background: var(--grad-leaf);
}

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.2s var(--ease-spring);
}
.theme-toggle:hover { color: var(--orange-hot); border-color: var(--orange); transform: rotate(40deg); }

.profile-menu { position: relative; }
.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.profile-btn:hover { border-color: var(--orange); background: var(--panel-hover); }
.profile-avatar { width: 28px; height: 28px; border-radius: 50%; }
.profile-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  min-width: 170px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  z-index: 300;
}
.profile-dropdown a {
  display: block;
  padding: 11px 16px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none !important;
}
.profile-dropdown a:hover { background: var(--panel-hover); color: var(--orange-hot); }

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .top-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line-strong);
    padding: 8px;
  }
  .top-nav.is-open { display: flex; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    padding: 8px;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 1px; }
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 70px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}
.footer-leaf {
  flex: none;
  width: 24px;
  height: 24px;
  background: var(--leaf);
  opacity: 0.7;
  -webkit-mask: var(--leaf-mark) no-repeat center / contain;
          mask: var(--leaf-mark) no-repeat center / contain;
}

/* ---- Hero ---- */
/* ---- Masthead ----
   Text column and art sit side by side and BOTH are content: the art is the
   product, not decoration behind the words. Text leads on wide screens because
   the first thing a visitor needs is what this is; the art leads visually
   because it is the only thing on the page that is unmistakably Naruto. */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 5vw, 60px) 0 clamp(20px, 3vw, 34px);
}
.masthead-title {
  font-family: var(--font-display);
  /* Anton is already tight; -0.01em stops the caps closing up at display size
     without the letterspacing looking applied. */
  font-size: clamp(2.3rem, 6.2vw, 4.1rem);
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.masthead-title .accent { color: var(--orange-hot); }
.masthead-lede {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.62;
  max-width: 54ch;          /* a measure, not a magic pixel width */
  margin: 0 0 14px;
}
.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 12px;
}
.masthead-note { color: var(--muted); font-size: 0.88rem; margin: 0; max-width: 46ch; }

/* The key art hangs on the village notice board: a timber frame with the grain
   running up the posts, rather than a 1px hairline. */
.masthead-art {
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, var(--bark-light), var(--bark) 22%, var(--bark) 78%, #1c150f);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    var(--shadow);
}
.masthead-art img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.masthead-art figcaption {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
  margin-top: 10px;
  padding: 0 2px;
}

@media (max-width: 860px) {
  .masthead { grid-template-columns: 1fr; }
  .masthead-art { order: -1; }
}

/* ---- Room list ----
   Open tables are postings on the mission board: each row pinned by a timber
   edge on the left, which also gives the list a rhythm without a heavy border
   around every row. */
.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 14px 22px;
  overflow: hidden;
}
.room-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--grad-leaf);
  opacity: 0.75;
}
.room-row .room-name { font-weight: 800; }
.room-row .room-meta { color: var(--muted); font-size: 0.86rem; }

/* ---- How to play: the mission scroll ----
   Was a six-cell grid of headed paragraphs, which asked a first-time visitor to
   read six things in no particular order before they knew which mattered. It is
   now five NUMBERED steps in one column, because the rules are sequential — you
   win by, on your turn, doing these things in this order — and a numbered list
   is the shape that says so. Set on washi with sumi ink and hanko-red numerals:
   a scroll is what the village hands you when you are told how a thing is done.

   Deliberately NOT the three-up icon-card feature grid. There are no icons,
   nothing is a card, and the numbers are content rather than decoration. */
.scroll {
  position: relative;
  /* A scroll is a narrow thing, and the steps are set to a 62ch measure — at the
     full 1280px wrap the sheet ran on for another 400px of blank parchment past
     the end of every line. Sized to the content and centred instead. */
  width: min(860px, 100%);
  margin: 26px auto 0;
  padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 52px);
  border-radius: 3px;
  background: var(--scroll);
  color: var(--scroll-ink);
  box-shadow:
    inset 0 0 0 1px var(--scroll-edge),
    /* the sheet's own curl, top and bottom */
    inset 0 9px 16px -10px rgba(90, 74, 44, 0.55),
    inset 0 -9px 16px -10px rgba(90, 74, 44, 0.55),
    var(--shadow-lift);
}
/* The rollers the sheet is wound on. */
.scroll::before,
.scroll::after {
  content: '';
  position: absolute;
  left: -6px; right: -6px;
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--bark-light), var(--bark) 60%, #16100b);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.scroll::before { top: -7px; }
.scroll::after  { bottom: -7px; }

.scroll-steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(16px, 2.2vw, 24px);
}
.scroll-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
/* The numeral, stamped like a seal. */
.scroll-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--seal);
  color: #fdf6e6;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.3);
}
.scroll-steps b {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--scroll-ink);
}
.scroll-steps p {
  margin: 0;
  color: var(--scroll-ink-soft);
  font-size: 0.97rem;
  line-height: 1.6;
  max-width: 62ch;
}
/* Terms the game prints on its cards. Highlighted because these five words are
   the entire vocabulary a new player is missing. */
.scroll-steps .t {
  font-weight: 700;
  color: #7a3a10;
  white-space: nowrap;
}
.scroll-foot {
  margin: clamp(22px, 3vw, 30px) 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--scroll-edge);
  color: var(--scroll-ink-soft);
  font-size: 0.9rem;
  line-height: 1.62;
  max-width: 76ch;
}
@media (max-width: 560px) {
  .scroll-steps li { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .scroll-steps li::before { width: 27px; height: 27px; font-size: 0.95rem; }
}

/* ---- Patch notes ---- */
.patch-panel { white-space: pre-wrap; }

/* ---- Announcement bar ---- */
.announce-bar {
  background: var(--grad-primary);
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.92rem;
}
