/* Hogwarts Memorial Archive — clean, responsive homepage only */
.home-layout {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 20px 18px;
  box-sizing: border-box;
  text-align: center;
}
.home-layout .home-frame {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 27px 34px 24px;
  box-sizing: border-box;
  border: 2px solid #8e7656;
  border-radius: 12px;
  background: #1b1e20;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,.16), inset 0 0 0 7px #1b1e20, inset 0 0 0 8px #5d4c3b;
}
.home-layout .home-frame .archive-header { margin: 0; padding: 0; }
.home-layout .home-frame .archive-eyebrow {
  margin: 0 0 12px;
  color: #b79a6c;
  font-size: 11px;
  letter-spacing: 1.5px;
  line-height: 1.6;
}
.home-layout .home-frame h1 {
  margin: 0;
  color: #ede4d6;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(38px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.04;
  overflow-wrap: normal;
}
.home-layout .home-magic-ornament {
  width: min(190px, 75%);
  margin: 10px auto 3px;
  color: #b79a6c;
}
.home-layout .home-magic-ornament svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75px;
}
.home-layout .home-frame .archive-subtitle {
  margin: 8px 0 0;
  color: #d9c6ab;
  font-style: normal;
  font-size: 16px;
  line-height: 1.5;
}
.home-layout .home-rule { width: 60px; height: 1px; margin: 16px auto; background: #b79a6c; }
.home-layout .home-description { margin: 0 auto 7px; color: #ede4d6; font-size: 13px; line-height: 1.7; }
.home-layout .home-game { margin: 0; color: #beb1a2; font-size: 11px; line-height: 1.6; }
.home-layout .home-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px auto 0;
  width: 100%;
}
.home-layout .home-actions button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 74px;
  flex: 1 1 160px;
  max-width: 240px;
  padding: 9px 10px;
  background: #665347;
  border: 1px solid #b79a6c;
  border-radius: 6px;
  color: #ede4d6;
  font-family: 'Cormorant Garamond', 'Noto Serif Thai', Georgia, serif;
  font-size: 17px;
  line-height: 1.3;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.home-layout .home-actions button:hover { background: #806a51; transform: translateY(-2px); }
.home-layout .home-actions button:focus-visible { outline: 2px solid #ede4d6; outline-offset: 3px; }
.home-layout .home-actions button[hidden] { display: none !important; }
.home-layout .home-actions .home-action-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 5px;
  color: #ede4d6;
}
.home-layout .home-actions .action-title {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.home-layout .home-actions .action-sub {
  display: block;
  margin-top: 4px;
  color: #e2d0b5;
  font-size: 12px;
  font-weight: 400;
}
.home-layout .home-actions .action-sub { display: block; margin-top: 2px; color: #e2d0b5; font-size: 16px; font-weight: 400; }
.home-layout .auth-panel { margin: 22px auto 0; }
.home-layout .home-cover-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 17px auto 0;
  color: #b79a6c;
  font-size: 11px;
}
.home-layout .home-cover-flourish::before,
.home-layout .home-cover-flourish::after {
  content: '';
  display: block;
  width: 55px;
  height: 1px;
  background: #665347;
}
.home-layout .home-cover-flourish span:nth-child(2) { font-size: 8px; opacity: .75; }
/* Override the global `section { margin-top:90px; padding:30px }` rule. */
.home-layout .home-closing {
  max-width: 720px;
  margin: 14px auto 0;
  padding: 0 8px;
  border: 0;
  text-align: center;
}
.home-layout .home-closing p {
  margin: 0;
  color: #cbbba6;
  font-size: 13px;
  font-style: normal;
  line-height: 1.7;
}

@media (max-width: 600px) {
  /* `style.css` has position:fixed!important for Logout: explicitly override it. */
  body > #logoutBtn.logout-top-right {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: block;
    width: fit-content;
    margin: 10px 14px 0 auto;
    padding: 8px 15px;
  }
  body > #logoutBtn.logout-top-right[hidden] { display: none !important; }
  .home-layout {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 12px 18px;
  }
  .home-layout .home-frame {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 23px 16px 20px;
    box-shadow: inset 0 0 0 5px #1b1e20, inset 0 0 0 6px #5d4c3b;
  }
  .home-layout .home-frame .archive-eyebrow {
    margin-bottom: 10px;
    font-size: 9px;
    letter-spacing: .8px;
  }
  .home-layout .home-frame h1 {
    font-size: clamp(29px, 8vw, 38px);
    line-height: 1.06;
    overflow-wrap: normal;
  }
  .home-layout .home-magic-ornament { width: min(155px, 70%); margin: 9px auto 3px; }
  .home-layout .home-magic-ornament svg { width: 100%; height: auto; max-height: 65px; }
  .home-layout .home-frame .archive-subtitle { margin-top: 6px; font-size: 13px; }
  .home-layout .home-rule { margin: 12px auto; }
  .home-layout .home-description { margin-bottom: 6px; font-size: 11px; line-height: 1.65; }
  .home-layout .home-game { font-size: 10px; }
  .home-layout .home-actions { gap: 8px; margin-top: 15px; flex-direction: row; align-items: stretch; }
  .home-layout .home-actions button {
    flex: 1 1 0;
    width: 0;
    max-width: none;
    min-height: 76px;
    padding: 8px 4px;
    font-size: 14px;
  }
  .home-layout .home-actions .home-action-icon { width: 19px; height: 19px; margin-bottom: 4px; }
  .home-layout .home-actions .action-sub { font-size: 9px; }
  .home-layout .home-cover-flourish { margin-top: 14px; }
  .home-layout .home-closing { margin-top: 14px; padding: 0 6px; }
  .home-layout .home-closing p { font-size: 12px; }
}
@media (max-width: 350px) {
  .home-layout { padding-left: 8px; padding-right: 8px; }
  .home-layout .home-frame { padding-left: 12px; padding-right: 12px; }
  .home-layout .home-frame h1 { font-size: 29px; }
  .home-layout .home-actions button { font-size: 12px; }
  .home-layout .home-actions .action-sub { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-layout .home-actions button { transition: none; }
  .home-layout .home-actions button:hover { transform: none; }
}


/* Homepage cover — fine parchment grain + soft light, inside gold frame only.
   Preserve the existing #1b1e20 base, gold borders and all layout. */
.home-layout .home-frame {
  background-color: #1b1e20;
  background-image:
    radial-gradient(circle at 17% 23%, rgba(255,236,196,.09) 0 .75px, transparent 1.2px),
    radial-gradient(circle at 73% 67%, rgba(255,236,196,.07) 0 .7px, transparent 1.2px),
    repeating-linear-gradient(108deg, rgba(255,245,220,.022) 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 15% 0%, rgba(255,235,198,.10), transparent 65%),
    linear-gradient(160deg, rgba(255,255,255,.025), transparent 48%, rgba(0,0,0,.16)) !important;
  background-size: 29px 37px, 41px 47px, auto, auto, auto;
}


/* Mobile homepage actions — one stable grid for guests and signed-in users.
   Register spans both columns only while it is visible. */
@media (max-width: 600px) {
  .home-layout .home-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    align-items: stretch !important;
  }
  .home-layout .home-actions > #registerBtn:not([hidden]) {
    grid-column: 1 / -1 !important;
  }
  .home-layout .home-actions > button:not([hidden]),
  .home-layout .home-actions > #openLettersBtn {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 98px !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 12px 8px !important;
    flex: none !important;
    text-align: center !important;
  }
  .home-layout .home-actions > button[hidden] {
    display: none !important;
  }
  .home-layout .home-actions .action-title {
    overflow-wrap: break-word;
  }
}
