/* ============================================================
   Born from Blood — Home Lobby  (home.css)
   Scoped entirely under .lby-page — does not affect other pages.
   ============================================================ */

/* ── Reset for lobby page ── */
.lby-page {
  margin: 0;
  padding: 0;
  width: 100%;
  background: #040207;
  color: #f2e6d4;
  font-family: "Cinzel", serif;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Cancel generic element rules from style.css */
.lby-page header {
  position: relative !important;
  padding: 0 !important;
}

.lby-page main {
  padding: 0 !important;
  overflow: hidden !important;
}

/* Hide standard header machinery (hamburger / overlay / brand-logo) when they bleed in */
.lby-page .nav-check,
.lby-page .nav-burger,
.lby-page .nav-overlay,
.lby-page .brand-logo { display: none !important; }

/* Hide auth.js injected button — lobby uses its own profile chip */
.lby-page #authBtn { display: none !important; }

/* ============================================================
   GAME LOADING SCREEN
   ============================================================ */
.lby-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(100,18,44,.24) 0%, rgba(14,4,14,.92) 34%, rgba(3,1,5,.99) 72%),
    linear-gradient(135deg, #020104 0%, #120413 48%, #030105 100%);
  color: #f2e6d4;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity .7s ease, visibility .7s ease;
}

.lby-loader-seen .lby-loader {
  display: none;
}

.lby-loader::before,
.lby-loader::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.lby-loader::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(255,255,255,.035) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 7px);
  opacity: .34;
  animation: lbyLoadDrift 9s linear infinite;
}

.lby-loader::after {
  background:
    radial-gradient(circle at 18% 22%, rgba(190,26,58,.28) 0%, transparent 22%),
    radial-gradient(circle at 82% 76%, rgba(218,170,95,.16) 0%, transparent 26%),
    radial-gradient(circle at 50% 112%, rgba(0,0,0,.88) 0%, transparent 34%);
  filter: blur(8px);
}

.lby-load-aura {
  position: absolute;
  width: min(58vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(218,170,95,.08);
  box-shadow:
    0 0 140px rgba(128,18,44,.24),
    inset 0 0 120px rgba(218,170,95,.06);
  animation: lbyLoadPulse 2.7s ease-in-out infinite;
}

.lby-load-frame {
  position: relative;
  z-index: 2;
  width: min(78vw, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lby-load-logo {
  width: min(74vw, 620px);
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 12px 24px rgba(0,0,0,.72))
    drop-shadow(0 0 22px rgba(133,25,66,.38));
  animation: lbyLogoWake 1.9s ease-in-out infinite alternate;
}

.lby-load-rule {
  width: min(58vw, 520px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(218,170,95,.42), rgba(160,24,58,.62), rgba(218,170,95,.42), transparent);
  box-shadow: 0 0 20px rgba(160,24,58,.45);
}

.lby-load-meta {
  width: min(58vw, 520px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .24em;
  color: rgba(242,230,212,.72);
  text-shadow: 0 2px 12px rgba(0,0,0,.9);
}

.lby-load-meta strong {
  color: #e6b45e;
  font-size: 12px;
  letter-spacing: .12em;
}

.lby-load-detail {
  width: min(58vw, 520px);
  min-height: 18px;
  margin-top: -6px;
  color: rgba(242,230,212,.54);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}

.lby-load-track {
  width: min(58vw, 520px);
  height: 8px;
  padding: 1px;
  border: 1px solid rgba(218,170,95,.28);
  background: rgba(4,1,5,.72);
  box-shadow:
    inset 0 0 12px rgba(0,0,0,.82),
    0 0 28px rgba(128,18,44,.18);
}

.lby-load-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #6d1028, #b21e45 48%, #e6b45e 100%);
  box-shadow: 0 0 18px rgba(190,34,70,.62);
  transition: width .18s ease-out;
}

.lby-load-steps {
  width: min(58vw, 520px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: -4px;
}

.lby-load-step {
  position: relative;
  padding: 7px 9px 7px 24px;
  border: 1px solid rgba(218,170,95,.12);
  background: rgba(5,2,6,.42);
  color: rgba(242,230,212,.36);
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
}

.lby-load-step::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translateY(-50%) rotate(45deg);
  border: 1px solid currentColor;
  background: transparent;
}

.lby-load-step.is-active {
  border-color: rgba(190,34,70,.42);
  color: rgba(255,199,151,.78);
  box-shadow: inset 0 0 16px rgba(190,34,70,.08);
}

.lby-load-step.is-done {
  border-color: rgba(218,170,95,.3);
  color: rgba(230,180,94,.82);
}

.lby-load-step.is-done::before {
  background: #e6b45e;
  box-shadow: 0 0 10px rgba(230,180,94,.52);
}

.lby-loader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes lbyLoadDrift {
  from { transform: translateX(-3%); }
  to { transform: translateX(3%); }
}

@keyframes lbyLoadPulse {
  0%, 100% { transform: scale(.96); opacity: .5; }
  50% { transform: scale(1.04); opacity: .92; }
}

@keyframes lbyLogoWake {
  from { transform: translateY(0); filter: drop-shadow(0 12px 24px rgba(0,0,0,.72)) drop-shadow(0 0 18px rgba(133,25,66,.28)); }
  to { transform: translateY(-3px); filter: drop-shadow(0 16px 28px rgba(0,0,0,.78)) drop-shadow(0 0 30px rgba(178,30,69,.48)); }
}

@media (prefers-reduced-motion: reduce) {
  .lby-loader,
  .lby-load-bar,
  .lby-loader::before,
  .lby-load-aura,
  .lby-load-logo,
  .lby-load-step {
    animation: none;
    transition-duration: .15s;
  }
}

/* ============================================================
   HEADER
   ============================================================ */
.lby-hdr {
  flex-shrink: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(90deg, rgba(8,4,12,.98) 0%, rgba(6,3,10,.96) 60%, rgba(10,4,14,.98) 100%);
  border-bottom: 1px solid rgba(186,142,72,.2);
  box-shadow: 0 2px 24px rgba(0,0,0,.55);
  z-index: 200;
  position: relative;
}

.lby-hdr-l {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.lby-logo {
  height: 34px;
  width: auto;
  flex-shrink: 0;
}

.lby-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  overflow: hidden;
}

.lby-nav-a {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .05em;
  color: rgba(242,230,212,.48);
  text-decoration: none;
  padding: 5px 9px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color .14s, background .14s;
}

.lby-nav-a:hover { color: #f2e6d4; background: rgba(255,255,255,.06); }

.lby-nav-active {
  color: #e6b45e;
  position: relative;
}

.lby-nav-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 9px;
  right: 9px;
  height: 2px;
  background: #e6b45e;
  border-radius: 2px;
}

.lby-hdr-r {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Resource bar */
.lby-res-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lby-res {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
}

.lby-res-ico { font-size: 15px; line-height: 1; }
.lby-res-ico-img { width: 22px; height: 22px; object-fit: contain; display: block; }

.lby-res-val {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 13px;
  color: #f2e6d4;
  letter-spacing: .02em;
  min-width: 20px;
}

/* Profile chip */
.lby-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(186,142,72,.2);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background .14s;
}

.lby-profile:hover { background: rgba(255,255,255,.11); }

.lby-profile-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(230,180,94,.35);
}

.lby-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.lby-profile-info strong {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 13px;
  color: #f2e6d4;
  letter-spacing: .02em;
}

.lby-profile-info small {
  font-size: 10px;
  font-family: sans-serif;
  color: rgba(242,230,212,.45);
  letter-spacing: .04em;
}

/* ============================================================
   MAIN — 4-column + bottom nav grid
   ============================================================ */
.lby-main {
  flex: 1;
  position: relative;
  display: grid;
  /* columns scale with viewport: utility | left panels | center art | right tiles */
  grid-template-columns: 62px clamp(280px, 24vw, 420px) 1fr clamp(430px, 29vw, 520px);
  grid-template-rows: 1fr;
  overflow: hidden;
  min-height: 0;
}

/* ── Background art ── */
.lby-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #040207;
}

.lby-bg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}

.lby-bg-active {
  opacity: .92;
}

/* Vignette: dark left + dark right + dark bottom */
.lby-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(4,2,7,.98)   0%,
      rgba(4,2,7,.90)  12%,
      rgba(4,2,7,.55)  26%,
      transparent      42%,
      transparent      60%,
      rgba(4,2,7,.60)  75%,
      rgba(4,2,7,.92)  87%,
      rgba(4,2,7,.98) 100%
    ),
    linear-gradient(180deg,
      rgba(4,2,7,.25)  0%,
      transparent      15%,
      transparent      68%,
      rgba(4,2,7,.88) 100%
    );
}

/* ── Utility icon strip (col 1) ── */
.lby-util {
  grid-column: 1;
  grid-row: 1;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 0 16px;
}

.lby-u {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: rgba(242,230,212,.86);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  transition: background .14s, color .14s, border-color .14s;
}

.lby-u svg { width: 24px; height: 24px; filter: drop-shadow(0 2px 7px rgba(0,0,0,.72)); }

.lby-u:hover {
  background: transparent;
  color: #e6b45e;
  border-color: transparent;
}

.lby-u-dot::after {
  content: "";
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #e04b1a;
  border: 1px solid rgba(4,2,8,.7);
}

/* ── Left panels column (col 2) ── */
.lby-left {
  grid-column: 2;
  grid-row: 1;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 14px 4px;
  overflow: hidden;
}

/* Featured Pack */
.lby-fp {
  position: relative;
  background: rgba(5,2,8,.75);
  border: 1px solid rgba(186,142,72,.22);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.lby-fp::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(5,2,8,.84) 0%, rgba(5,2,8,.56) 48%, rgba(5,2,8,.78) 100%),
    linear-gradient(90deg, rgba(5,2,8,.86), transparent 72%);
  pointer-events: none;
}

.lby-fp-bg {
  position: absolute;
  inset: -20px;
  z-index: 0;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  object-position: center;
  opacity: .5;
  filter: blur(16px) saturate(1.18) brightness(.82);
  transform: scale(1.04);
  transition: opacity .35s ease;
  pointer-events: none;
}

.lby-fp > *:not(.lby-fp-bg) {
  position: relative;
  z-index: 2;
}

.lby-fp-head {
  padding: 13px 15px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lby-fp-kicker {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .28em;
  color: rgba(230,180,94,.72);
  display: block;
}

.lby-fp-name {
  display: block;
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(21px, 2.3vw, 30px);
  line-height: .95;
  letter-spacing: .01em;
  color: #fff8ea;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}

.lby-fp-cta {
  display: inline-block;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  color: #120608;
  background: linear-gradient(135deg, #e6b45e, #bf7828);
  padding: 6px 14px;
  border-radius: 5px;
  text-decoration: none;
  margin-top: 2px;
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(190,120,40,.4);
  transition: filter .14s, transform .1s;
}

.lby-fp-cta:hover { filter: brightness(1.12); transform: translateY(-1px); }

.lby-fp-art {
  display: block;
  position: relative;
  height: clamp(110px, 14vh, 170px);
  overflow: hidden;
  border-top: 1px solid rgba(218,170,95,.16);
  background: rgba(4,2,7,.44);
}

.lby-fp-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,236,190,.08), transparent 52%),
    linear-gradient(90deg, rgba(6,2,10,.42), rgba(6,2,10,.12) 45%, rgba(6,2,10,.52));
  pointer-events: none;
}

/* Tile background art */
.lby-tile-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .38;
  pointer-events: none;
  transition: opacity .3s ease;
}

.lby-tile:hover .lby-tile-bg { opacity: .52; }

.lby-tile > *:not(.lby-tile-bg) { position: relative; }

.lby-fp-art #fpArtImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(5px) saturate(1.08) brightness(.72);
  transform: scale(1.08);
  transition: transform .3s ease, opacity .35s ease, filter .35s ease;
}

.lby-fp-logo-img {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(72%, 255px);
  max-height: 78%;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 8px 14px rgba(0,0,0,.9))
    drop-shadow(0 0 16px rgba(238,197,128,.22));
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

.lby-dot {
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lby-dot:hover { transform: scale(1.3); }

.lby-fp-art:hover #fpArtImg { transform: scale(1.11); }

.lby-fp-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 7px 0 8px;
}

.lby-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
}

.lby-dot-on { background: #e6b45e; }

/* News panel */
.lby-news {
  background: rgba(5,2,8,.72);
  border: 1px solid rgba(186,142,72,.14);
  border-radius: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 0;
}

.lby-news-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.lby-news-label {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: 9.5px;
  letter-spacing: .22em;
  color: rgba(242,230,212,.7);
}

.lby-news-more {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 10px;
  color: #e6b45e;
  text-decoration: none;
  letter-spacing: .08em;
  transition: opacity .14s;
}

.lby-news-more:hover { opacity: .7; }

.lby-news-list {
  flex: 1;
  overflow-y: auto;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(186,142,72,.18) transparent;
}

/* news card rows — rendered by home.js */
.lby-nc {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.038);
  border: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
  color: inherit;
  transition: background .14s;
}

.lby-nc:hover { background: rgba(186,142,72,.1); }

.lby-nc-thumb {
  width: 54px;
  height: 38px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.lby-nc-thumb img { width: 100%; height: 100%; object-fit: cover; }

.lby-nc-empty {
  width: 54px;
  height: 38px;
  border-radius: 5px;
  background: rgba(186,142,72,.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.lby-nc-body { flex: 1; min-width: 0; }

.lby-nc-tag {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: .18em;
  color: #e6b45e;
  display: block;
  margin-bottom: 2px;
}

.lby-nc-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 11.5px;
  color: #f2e6d4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

.lby-nc-date {
  font-size: 9.5px;
  font-family: sans-serif;
  color: rgba(242,230,212,.38);
  margin-top: 1px;
}

.lby-empty {
  padding: 18px;
  text-align: center;
  color: rgba(242,230,212,.3);
  font-size: 12px;
  font-family: sans-serif;
}

/* News popup */
.lby-news-modal {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(2,1,3,.9), rgba(9,4,7,.62) 50%, rgba(2,1,3,.88)),
    linear-gradient(180deg, rgba(70,12,24,.3), rgba(0,0,0,.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lby-news-modal[hidden] { display: none; }
.lby-page.lby-news-modal-open { overflow: hidden; }
.lby-news-modal,
.lby-news-modal * {
  box-sizing: border-box;
}

.lby-news-pop {
  position: relative;
  width: min(860px, calc(100vw - 36px));
  max-height: min(680px, calc(100dvh - 36px));
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(0, 1fr);
  color: #f2e6d4;
  background:
    linear-gradient(145deg, rgba(20,8,13,.98), rgba(6,3,8,.96) 48%, rgba(16,8,6,.97)),
    rgba(7,3,8,.96);
  border: 1px solid rgba(224,162,60,.36);
  border-radius: 8px;
  box-shadow:
    0 30px 100px rgba(0,0,0,.86),
    inset 0 0 0 1px rgba(255,255,255,.05);
  overflow: hidden;
}
.lby-news-pop.is-poster-only {
  width: min(1120px, calc(100vw - 36px), 167dvh);
  max-height: none;
  aspect-ratio: 1672 / 941;
  display: block;
  grid-template-columns: none;
  background: #050208;
}
.lby-news-pop::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 78px),
    linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 78px);
  opacity: .12;
}

.lby-news-pop-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  color: rgba(242,230,212,.72);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color .14s, background .14s, border-color .14s;
}
.lby-news-pop-close:hover,
.lby-news-pop-close:focus-visible {
  color: #fff;
  background: rgba(224,162,60,.14);
  border-color: rgba(224,162,60,.38);
  outline: none;
}

.lby-news-pop-media {
  position: relative;
  z-index: 2;
  min-height: 420px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.42)),
    url("assets/bg-kaisen.jpg") center / cover no-repeat;
  border-right: 1px solid rgba(224,162,60,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lby-news-pop.is-poster-only .lby-news-pop-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-right: 0;
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.38)),
    #050208;
}
.lby-news-pop-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.64));
  pointer-events: none;
}
.lby-news-pop.is-poster-only .lby-news-pop-media::after {
  display: none;
}
.lby-news-pop-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lby-news-pop.is-poster-only .lby-news-pop-media img {
  display: block;
  object-fit: contain;
  background: #050208;
}
.lby-news-pop-media img[hidden],
.lby-news-pop-mark[hidden] {
  display: none;
}

.lby-news-pop-mark {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(224,162,60,.38);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(242,230,212,.84);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 3px 18px rgba(0,0,0,.9);
  background: rgba(5,2,8,.44);
  box-shadow: inset 0 0 46px rgba(0,0,0,.55);
}

.lby-news-pop-body {
  position: relative;
  z-index: 2;
  min-height: 0;
  overflow: auto;
  padding: 46px 38px 32px;
  display: flex;
  flex-direction: column;
}
.lby-news-pop-kicker {
  margin-bottom: 12px;
  color: #e0a23c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}
.lby-news-pop-title {
  margin: 0;
  color: #fff;
  font-size: 34px;
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 22px rgba(0,0,0,.8);
}
.lby-news-pop-text {
  margin: 16px 0 0;
  color: rgba(242,230,212,.74);
  font: 14px/1.65 Arial, sans-serif;
  max-width: 44em;
}

.lby-news-pop-list {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}
.lby-news-pop-list[hidden] { display: none; }
.lby-news-pop-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  color: inherit;
  text-decoration: none;
  transition: background .14s, border-color .14s;
}
.lby-news-pop-item:hover {
  background: rgba(224,162,60,.1);
  border-color: rgba(224,162,60,.2);
}
.lby-news-pop-item span {
  color: #e0a23c;
  font: 800 9px Arial, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.lby-news-pop-item strong {
  color: #f2e6d4;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lby-news-pop-actions {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.lby-news-pop-primary,
.lby-news-pop-muted {
  min-height: 42px;
  border-radius: 7px;
  font-family: "Cinzel", serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .14s, filter .14s, background .14s, border-color .14s;
}
.lby-news-pop-primary {
  padding: 0 18px;
  color: #1b0d05;
  background: linear-gradient(180deg, #f2c368, #b9772e);
  border: 1px solid rgba(255,230,168,.46);
  box-shadow: 0 8px 22px rgba(0,0,0,.42);
}
.lby-news-pop-muted {
  padding: 0 14px;
  color: rgba(242,230,212,.76);
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.1);
}
.lby-news-pop-primary:hover,
.lby-news-pop-muted:hover,
.lby-news-pop-primary:focus-visible,
.lby-news-pop-muted:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}
.lby-news-pop-muted:hover,
.lby-news-pop-muted:focus-visible {
  background: rgba(224,162,60,.1);
  border-color: rgba(224,162,60,.26);
}

.lby-news-pop-skip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0,0,0,.48);
  color: rgba(242,230,212,.72);
  font: 700 11px Arial, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: color .14s, background .14s, border-color .14s;
}
.lby-news-pop-skip:hover,
.lby-news-pop-skip:focus-visible {
  color: #fff;
  background: rgba(224,162,60,.16);
  border-color: rgba(224,162,60,.34);
  outline: none;
}

@media (max-width: 760px) {
  .lby-news-modal {
    align-items: flex-start;
    padding: 14px;
    overflow: auto;
  }
  .lby-news-pop {
    width: 100%;
    max-height: none;
    grid-template-columns: 1fr;
  }
  .lby-news-pop.is-poster-only {
    width: min(1120px, calc(100vw - 28px), 167dvh);
    max-height: none;
  }
  .lby-news-pop-media {
    min-height: 184px;
    border-right: 0;
    border-bottom: 1px solid rgba(224,162,60,.18);
  }
  .lby-news-pop.is-poster-only .lby-news-pop-media {
    border-bottom: 0;
  }
  .lby-news-pop-mark {
    width: 94px;
    height: 94px;
    font-size: 22px;
  }
  .lby-news-pop-body {
    padding: 28px 18px 20px;
  }
  .lby-news-pop-title {
    font-size: 26px;
  }
  .lby-news-pop-text {
    font-size: 13px;
  }
  .lby-news-pop-actions {
    align-items: stretch;
  }
  .lby-news-pop-primary,
  .lby-news-pop-muted {
    flex: 1 1 150px;
  }
  .lby-news-pop-skip {
    right: 10px;
    bottom: 10px;
    min-height: 30px;
    font-size: 10.5px;
  }
}

/* ── Center hero column (col 3) ── */
.lby-center {
  grid-column: 3;
  grid-row: 1;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  padding: 0 28px 28px;
  pointer-events: none;
}

.lby-hero-cap { pointer-events: auto; }

.lby-hero-sub {
  font-family: "Cinzel", serif;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .2em;
  color: rgba(242,230,212,.5);
  margin: 0 0 4px;
  text-shadow: 0 1px 8px rgba(0,0,0,.9);
  transition: opacity .35s ease-in-out;
}

.lby-hero-name {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(22px, 3.5vh, 34px);
  color: #fff;
  margin: 0 0 7px;
  text-shadow: 0 2px 20px rgba(0,0,0,.85);
  letter-spacing: .07em;
  transition: opacity .35s ease-in-out;
}

.lby-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 700;
  color: rgba(242,230,212,.58);
  letter-spacing: .12em;
  padding: 4px 12px;
  border: 1px solid rgba(186,142,72,.25);
  border-radius: 4px;
  background: rgba(4,2,7,.45);
}

/* ── Right action tiles (col 4) ── */
.lby-right {
  grid-column: 4;
  grid-row: 1;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 34px 26px 24px 10px;
  overflow: hidden;
}

.lby-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 7px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(218,170,95,.55);
  background:
    linear-gradient(90deg, rgba(5,3,7,.78), rgba(5,3,7,.46)),
    var(--tile-bg, none),
    rgba(5,3,7,.58);
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .17s, border-color .17s, transform .12s, box-shadow .17s;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 14px 28px rgba(0,0,0,.24);
}

.lby-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}

.lby-tile:hover {
  transform: translateX(-3px);
  border-color: rgba(230,180,94,.9);
  background: rgba(12,5,18,.68);
  box-shadow: 4px 0 28px rgba(0,0,0,.45);
}

/* PLAY tile */
.lby-tile-play {
  background:
    linear-gradient(90deg, rgba(36,9,12,.82), rgba(5,3,8,.48)),
    var(--tile-bg, none),
    rgba(5,3,7,.58);
  background-size: cover;
  background-position: center;
  border-color: rgba(218,170,95,.68);
  min-height: clamp(116px, 16vh, 148px);
}

.lby-tile-play:hover {
  background: linear-gradient(135deg, rgba(130,20,28,.92), rgba(14,6,22,.94));
  box-shadow: 4px 0 32px rgba(130,20,28,.3);
}

.lby-t-ico {
  flex-shrink: 0;
  width: clamp(58px, 7vh, 84px); height: clamp(58px, 7vh, 84px);
  display: flex; align-items: center; justify-content: center;
  opacity: .82;
  filter: drop-shadow(0 7px 12px rgba(0,0,0,.48));
}

.lby-t-ico img { width: 100%; height: 100%; object-fit: contain; }

.lby-t-ico-lg { width: clamp(74px, 9vh, 104px); height: clamp(74px, 9vh, 104px); }

.lby-t-body { flex: 1; min-width: 0; }

.lby-t-name {
  display: block;
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(21px, 2.6vh, 30px);
  color: #fff;
  letter-spacing: .01em;
  margin-bottom: 5px;
  line-height: .98;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,.85);
}

.lby-tile-play .lby-t-name { font-size: clamp(28px, 4.2vh, 42px); letter-spacing: .01em; }

.lby-t-sub {
  font-size: clamp(11px, 1.45vh, 14px);
  font-family: sans-serif;
  color: rgba(242,230,212,.74);
  line-height: 1.5;
  letter-spacing: .01em;
  text-shadow: 0 2px 8px rgba(0,0,0,.82);
}

/* Dual tile row */
.lby-tile-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex-shrink: 0;
}

.lby-tile-sm {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  min-height: clamp(112px, 15vh, 144px);
}

.lby-tile-sm .lby-t-body { flex: 1; min-width: 0; }
.lby-tile-sm .lby-t-ico { width: clamp(56px, 7vh, 78px); height: clamp(56px, 7vh, 78px); flex-shrink: 0; }
.lby-tile-sm .lby-t-name { font-size: clamp(18px, 2.3vh, 26px); letter-spacing: .01em; }
.lby-tile-sm .lby-t-sub { font-size: clamp(10.5px, 1.35vh, 13px); }

/* Wide action tile */
.lby-tile-wide {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background:
    linear-gradient(90deg, rgba(7,6,9,.78), rgba(7,6,9,.44)),
    var(--tile-bg, none),
    rgba(7,6,9,.56);
  background-size: cover;
  background-position: center;
  min-height: clamp(108px, 14vh, 136px);
}

.lby-tile-wide .lby-t-name { font-size: clamp(23px, 3vh, 32px); }

/* ============================================================
   MOBILE / TABLET (≤900px) — single-column, scrollable lobby
   Desktop pins a 4-column grid to the viewport; here we unlock
   scroll and stack: hero → tiles → featured/news → tools.
   ============================================================ */
@media (max-width: 900px) {
  /* unlock vertical scroll (desktop pins the page height) */
  .lby-page { height: auto; min-height: 100dvh; overflow: visible; }

  /* header: logo + resources + profile; 11-link text nav hidden (tiles ARE the nav) */
  .lby-hdr { position: sticky; top: 0; height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .lby-hdr-l { gap: 12px; }
  .lby-nav { display: none; }
  .lby-hdr-r { gap: 8px; flex: 1 1 100%; justify-content: space-between; }
  .lby-res-bar { gap: 5px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .lby-res-bar::-webkit-scrollbar { display: none; }
  .lby-res { padding: 4px 10px; flex-shrink: 0; }

  /* main: 4-column grid → vertical stack */
  .lby-main { display: flex; flex-direction: column; overflow: visible; }

  /* atmospheric background stays fixed behind the scrolling content */
  .lby-bg { position: fixed; inset: 0; height: 100dvh; }
  .lby-bg-slide { object-fit: cover; }
  .lby-bg-active { opacity: .45; }
  .lby-vignette { position: fixed; inset: 0;
    background: linear-gradient(180deg, rgba(4,2,7,.55) 0%, rgba(4,2,7,.8) 38%, rgba(4,2,7,.94) 100%); }

  /* full width + reorder: hero → tiles → featured/news → utility icons */
  .lby-util, .lby-left, .lby-center, .lby-right {
    grid-column: auto; grid-row: auto; width: auto; overflow: visible;
  }
  .lby-center { order: 1; align-items: flex-start; padding: 14px 16px 4px; }
  .lby-right  { order: 2; justify-content: flex-start; padding: 6px 14px 4px; gap: 10px; }
  .lby-left   { order: 3; padding: 8px 14px 4px; }
  .lby-util   { order: 4; flex-direction: row; justify-content: center; gap: 26px; padding: 10px 0 26px; }

  .lby-hero-cap { pointer-events: auto; }
  .lby-hero-name { font-size: clamp(26px, 7.5vw, 38px); }

  /* tiles: kill desktop slide-hover (would cause horizontal shift) */
  .lby-tile-play { min-height: 92px; }
  .lby-tile-play .lby-t-name { font-size: clamp(26px, 7vw, 36px); }
  .lby-right .lby-tile:hover { transform: none; }

  /* bound the news list so it doesn't dominate the scroll */
  .lby-news { flex: none; }
  .lby-news-list { max-height: 300px; }
}

/* Phones (≤560px): action tiles go full-width, one per row */
@media (max-width: 560px) {
  .lby-tile-duo { grid-template-columns: 1fr; }
  .lby-tile-sm { min-height: 78px; }
  .lby-tile-sm .lby-t-ico { width: clamp(46px, 13vw, 60px); height: clamp(46px, 13vw, 60px); }
}

/* ============================================================
   MAILBOX - dark fantasy inbox center
   ============================================================ */
.lby-mail-badge {
  position: absolute; top: -3px; right: -5px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: #d6442a; color: #fff;
  font-family: Arial, sans-serif; font-size: 9px; font-weight: 800;
  line-height: 15px; text-align: center;
  border: 1px solid rgba(255,224,167,.7);
  box-shadow: 0 0 12px rgba(214,68,42,.75);
}
.lby-mail-badge[hidden] { display: none; }

.mailbox-modal {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px, 2.4vw, 34px);
  background:
    linear-gradient(90deg, rgba(2,1,3,.92), rgba(7,4,5,.58) 44%, rgba(2,1,2,.88)),
    radial-gradient(circle at 78% 70%, rgba(103,23,16,.36), transparent 38%),
    radial-gradient(circle at 16% 18%, rgba(195,145,68,.14), transparent 27%),
    url("assets/mail/mail-bg-clean.png") center / cover no-repeat,
    linear-gradient(110deg, rgba(5,4,7,.95), rgba(13,8,8,.9) 52%, rgba(4,3,5,.96));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mailbox-modal,
.mailbox-modal * {
  box-sizing: border-box;
}
.mailbox-modal[hidden] { display: none; }

.mailbox-box {
  position: relative;
  width: min(1220px, calc(100vw - 52px));
  height: min(680px, calc(100dvh - 64px));
  min-height: min(560px, calc(100dvh - 64px));
  display: flex;
  flex-direction: column;
  color: #ead8b4;
  background:
    linear-gradient(90deg, rgba(5,4,5,.95), rgba(19,12,10,.84) 48%, rgba(5,4,5,.82)),
    radial-gradient(circle at 83% 54%, rgba(183,91,34,.15), transparent 33%);
  border: 1px solid rgba(205,158,82,.38);
  box-shadow:
    0 28px 100px rgba(0,0,0,.82),
    inset 0 0 0 1px rgba(255,236,184,.06),
    inset 0 0 80px rgba(0,0,0,.48);
  overflow: hidden;
}
.mailbox-box::before,
.mailbox-box::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.mailbox-box::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 72px);
  opacity: .12;
}
.mailbox-box::after {
  right: -8%; bottom: -18%;
  width: 52%; height: 66%;
  background:
    radial-gradient(circle at 70% 48%, rgba(158,74,37,.32), transparent 30%),
    linear-gradient(140deg, transparent 18%, rgba(216,171,102,.1) 19% 20%, transparent 21%),
    linear-gradient(25deg, transparent 0 48%, rgba(255,240,190,.08) 49% 51%, transparent 52%);
  filter: blur(.3px);
  opacity: .62;
}

.mailbox-topbar {
  position: relative; z-index: 1;
  height: 70px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 2.6vw, 34px);
  border-bottom: 1px solid rgba(213,161,76,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.2));
}
.mailbox-brand {
  display: flex; align-items: center; gap: 14px;
  font-family: "Cinzel", serif;
  font-size: clamp(22px, 2.5vw, 31px);
  font-weight: 800;
  letter-spacing: .02em;
  color: #f1d69e;
  text-shadow: 0 0 18px rgba(204,140,58,.38);
}
.mailbox-sigil,
.mailbox-empty-seal {
  width: 38px; height: 38px; display: inline-block; position: relative; flex: 0 0 auto;
  filter: drop-shadow(0 0 8px rgba(220,160,76,.5));
}
.mailbox-sigil::before,
.mailbox-sigil::after,
.mailbox-empty-seal::before,
.mailbox-empty-seal::after {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(224,177,94,.86);
  transform: rotate(45deg);
}
.mailbox-sigil::after,
.mailbox-empty-seal::after {
  inset: 13px;
  border-color: rgba(255,226,164,.92);
  transform: rotate(0deg);
  background: radial-gradient(circle, rgba(236,186,95,.75), transparent 58%);
}
.mailbox-top-actions {
  display: flex; align-items: center; gap: 12px;
}
.mailbox-resource {
  display: none;   /* currency pills removed from the mailbox header */
}
.mailbox-resource span {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
}
.mailbox-resource img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px rgba(218,171,90,.45));
}
.mailbox-resource-coin span {
  background: radial-gradient(circle at 32% 28%, #fff0a6, #d99b39 42%, #604019 78%);
  box-shadow: 0 0 9px rgba(220,162,64,.4);
}
.mailbox-resource-gem span {
  border-radius: 4px;
  background: linear-gradient(135deg, #f69090, #7f1427 56%, #29070c);
  transform: rotate(45deg);
  box-shadow: 0 0 9px rgba(190,36,58,.45);
}
.mailbox-help,
.mailbox-x {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  color: rgba(239,216,178,.72);
  background: transparent;
  font-family: "Cinzel", serif;
  font-size: 21px;
  transition: color .15s, transform .15s;
}
.mailbox-help {
  border-radius: 50%;
  border: 1px solid rgba(220,168,80,.22);
  font-size: 16px;
}
.mailbox-help:hover,
.mailbox-x:hover { color: #f4c66f; transform: translateY(-1px); }

.mailbox-content {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);   /* bound the row to the box — without this the
                                           panes grow to content height and push the
                                           claim button below the screen (unclickable) */
  overflow: hidden;
  gap: clamp(18px, 2vw, 28px);
  padding: 20px clamp(20px, 2.6vw, 34px) 22px;
}

.mailbox-left {
  min-height: 0;
  display: flex; flex-direction: column;
  border: 1px solid rgba(219,161,73,.08);
  background: rgba(30, 12, 22, .52);
  padding: 0;
}
.mailbox-tabs {
  flex: 0 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 44px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(216,164,76,.12);
}
.mailbox-tab {
  position: relative;
  border: 0; cursor: pointer;
  color: rgba(225,204,169,.55);
  background: linear-gradient(180deg, rgba(31,22,18,.38), rgba(5,4,5,.36));
  font-family: "Cinzel", serif;
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  transition: color .15s, background .15s;
}
.mailbox-tab span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 8px; padding: 0 5px;
  border-radius: 999px; background: rgba(178,49,36,.9);
  color: #fff3e2; font: 800 10px Arial, sans-serif;
  box-shadow: 0 0 8px rgba(178,49,36,.48);
}
.mailbox-tab.is-active {
  color: #ffe0a2;
  background:
    radial-gradient(circle at 50% 0, rgba(244,180,82,.22), transparent 48%),
    linear-gradient(180deg, rgba(84,49,29,.5), rgba(16,10,8,.46));
}
.mailbox-tab.is-active::after {
  content: ""; position: absolute; inset: auto 12px 0;
  height: 2px; background: linear-gradient(90deg, transparent, #d49a44, transparent);
}
.mailbox-tab:not(.is-active):hover { color: rgba(245,222,184,.78); }

.mailbox-toolbar {
  height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  color: rgba(230,207,170,.72);
}
.mailbox-selall {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font: 700 13px Arial, sans-serif;
}
.mailbox-selall input,
.mailbox-cb {
  width: 18px; height: 18px;
  accent-color: #d2a14f;
  cursor: pointer;
}
.mailbox-count {
  font: 700 14px Arial, sans-serif;
  color: rgba(236,215,180,.82);
}

.mailbox-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 8px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(196,145,75,.42) transparent;
}
.mailbox-empty {
  min-height: 210px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(230,210,176,.46);
  font: 700 14px Arial, sans-serif;
  text-align: center;
}
.mailbox-row {
  position: relative;
  height: 70px;
  display: flex; align-items: center; gap: 13px;
  padding: 0 14px;
  margin: 0 0 6px;
  border: 1px solid rgba(255,255,255,.04);
  background:
    linear-gradient(90deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    rgba(5,4,5,.48);
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .16s;
}
.mailbox-row[data-id]:hover {
  border-color: rgba(211,159,76,.34);
  background: linear-gradient(90deg, rgba(104,65,28,.24), rgba(18,12,10,.46));
}
.mailbox-row.is-selected {
  border-color: rgba(239,185,86,.9);
  background:
    linear-gradient(90deg, rgba(128,80,30,.45), rgba(34,20,12,.58));
  box-shadow: inset 0 0 0 1px rgba(255,231,162,.18), 0 0 18px rgba(214,148,58,.18);
}
.mailbox-row.is-selected::before {
  content: "";
  position: absolute; left: -1px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: #e9c064;
  box-shadow: 0 0 12px rgba(233,192,100,.75);
}
.mailbox-row-empty {
  cursor: default;
  opacity: .42;
  background: rgba(0,0,0,.2);
}
.mailbox-row-empty:hover {
  border-color: rgba(255,255,255,.04);
  background: rgba(0,0,0,.2);
}
.mailbox-row.is-claimed {
  opacity: .58;
  filter: saturate(.72);
}

.mailbox-env {
  flex: 0 0 auto;
  width: 58px; height: 46px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid rgba(223,178,91,.18);
  background:
    radial-gradient(circle at 50% 46%, rgba(232,190,104,.14), transparent 54%),
    rgba(0,0,0,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 8px 16px rgba(0,0,0,.34);
}
.mailbox-env img {
  width: 72px;
  height: 56px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.5));
}
.mailbox-env.has-gift {
  border-color: rgba(233,190,96,.4);
  box-shadow: inset 0 0 0 1px rgba(255,231,161,.08), 0 0 16px rgba(211,148,52,.18);
}
.mailbox-env span {
  position: absolute; right: -6px; bottom: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, #fff0a5, #c1782b 58%, #55230c);
  border: 1px solid rgba(255,227,161,.72);
  color: #1c0d06;
  font: 900 10px Arial, sans-serif;
  box-shadow: 0 0 9px rgba(219,143,50,.45);
}
.mailbox-env.opened { filter: grayscale(.55) brightness(.78); }

.mailbox-row-main { flex: 1; min-width: 0; }
.mailbox-sender {
  margin-bottom: 5px;
  font: 800 14px "Cinzel", serif;
  color: #ecd3a3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mailbox-subj {
  font: 600 12px Arial, sans-serif;
  color: rgba(229,206,170,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mailbox-time {
  flex: 0 0 auto;
  max-width: 74px;
  color: rgba(218,92,74,.85);
  font: 700 11px Arial, sans-serif;
  text-align: right;
}

.mailbox-foot {
  flex: 0 0 auto;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.mailbox-foot-actions {
  display: flex; align-items: center; gap: 12px;
}
.mailbox-claimall,
.mailbox-detail-claim {
  min-width: 150px;
  height: 44px;
  border: 1px solid rgba(255,226,155,.42);
  border-radius: 3px;
  color: #2f1a0a;
  background:
    linear-gradient(180deg, rgba(255,241,166,.42), transparent 34%),
    linear-gradient(135deg, #f3c56e, #a66522 72%);
  box-shadow: 0 0 18px rgba(206,139,52,.24), inset 0 0 0 1px rgba(255,255,255,.12);
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-weight: 900;
  letter-spacing: .02em;
  transition: filter .15s, transform .12s;
}
.mailbox-claimall:hover,
.mailbox-detail-claim:hover { filter: brightness(1.12); transform: translateY(-1px); }
.mailbox-claimall:disabled,
.mailbox-detail-claim:disabled { opacity: .55; cursor: default; transform: none; }
.mailbox-delsel,
.mailbox-detail-del {
  height: 44px;
  padding: 0 18px;
  border-radius: 3px;
  border: 1px solid rgba(180,72,64,.45);
  color: rgba(239,210,177,.84);
  background: linear-gradient(180deg, rgba(72,35,30,.46), rgba(19,10,10,.62));
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-weight: 800;
}
.mailbox-delsel:hover,
.mailbox-detail-del:hover {
  border-color: rgba(226,96,84,.82);
  color: #ffd3c8;
}
.mailbox-delsel:disabled { opacity: .55; cursor: default; }
.mailbox-pager {
  display: flex; align-items: center; gap: 10px;
  color: rgba(232,211,177,.64);
}
.mailbox-pager button {
  width: 30px; height: 30px;
  border: 1px solid rgba(223,172,86,.18);
  background: rgba(0,0,0,.28);
  color: rgba(238,216,181,.76);
  cursor: pointer;
  font-size: 22px;
}
.mailbox-pager button:hover { color: #f2c368; border-color: rgba(223,172,86,.42); }
.mailbox-pager span { min-width: 42px; text-align: center; font: 700 12px Arial, sans-serif; }

.mailbox-detail {
  position: relative;
  min-height: 0;
  display: flex;
  border: 1px solid rgba(224,171,83,.28);
  background:
    linear-gradient(90deg, rgba(8,6,7,.94), rgba(15,10,9,.84) 48%, rgba(6,4,5,.78)),
    radial-gradient(circle at 78% 48%, rgba(137,65,35,.28), transparent 34%),
    linear-gradient(90deg, rgba(11,9,9,.86), rgba(21,14,12,.62));
  box-shadow: inset 0 0 0 1px rgba(255,240,187,.035);
  overflow: hidden;
}
.mailbox-detail::before {
  content: "";
  position: absolute; inset: 0;
  background:
    /* darken the top-left so the subject/body text stays readable; let the
       candlelit scene (envelope is baked into the image) show centre/right */
    linear-gradient(118deg, rgba(7,4,5,.82) 0%, rgba(7,4,5,.44) 36%, rgba(7,4,5,.06) 60%, rgba(7,4,5,.30) 100%),
    url("assets/mail/mail-detail-bg.jpg") center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
}
.mailbox-detail-glow {
  position: absolute; right: -10%; bottom: -16%;
  width: 58%; height: 68%;
  background:
    radial-gradient(circle at 62% 40%, rgba(188,78,38,.2), transparent 32%),
    linear-gradient(120deg, transparent 35%, rgba(238,199,128,.08) 36% 38%, transparent 39%);
  pointer-events: none;
}
.mailbox-detail-card {
  position: relative; z-index: 1;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  padding: clamp(18px, 2vw, 28px) clamp(20px, 2.2vw, 32px) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(196,145,75,.42) transparent;
}
.mailbox-back {
  display: none;
  position: absolute; z-index: 3; left: 18px; top: 14px;
  border: 0; background: transparent; color: rgba(236,214,180,.72);
  font: 800 12px Arial, sans-serif; cursor: pointer;
}
.mailbox-empty-detail {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px;
  color: rgba(234,211,176,.54);
  text-align: center;
}
.mailbox-empty-detail strong {
  font-family: "Cinzel", serif;
  font-size: 24px;
  color: rgba(241,216,158,.78);
}
.mailbox-empty-detail small { font: 600 13px Arial, sans-serif; }
.mailbox-detail-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 32%);
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  padding-bottom: clamp(12px, 2vh, 20px);
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.mailbox-detail-subj {
  max-width: 620px;
  font-family: "Cinzel", serif;
  font-size: clamp(21px, 2.4vw, 29px);
  font-weight: 900;
  line-height: 1.12;
  color: #f4d79d;
  text-shadow: 0 0 12px rgba(205,139,57,.28);
}
.mailbox-detail-from {
  margin-top: 12px;
  color: rgba(220,97,78,.86);
  font: 800 13px Arial, sans-serif;
}
.mailbox-letter-art {
  min-height: clamp(72px, 12vh, 108px);
  position: relative;
  opacity: .9;
}
/* the envelope is baked into mail-detail-bg.jpg now — hide the overlay copy */
.mailbox-letter-art::before,
.mailbox-letter-art::after { display: none; }
.mailbox-detail-body {
  min-height: 0;
  max-width: 620px;
  padding-top: clamp(12px, 2vh, 20px);
  color: rgba(238,222,194,.82);
  font: 600 15px/1.7 Arial, sans-serif;
  white-space: pre-wrap;
  overflow-y: auto;
}
.mailbox-reward-label {
  position: relative;
  z-index: 2;
  margin: 12px 0 10px;
  color: rgba(237,218,187,.88);
  font: 900 15px "Cinzel", serif;
}
.mailbox-detail-reward {
  position: relative;
  z-index: 2;
  display: flex; flex-wrap: wrap; gap: 12px;
  min-height: 76px;
  padding-bottom: 12px;
}
.mailbox-reward-tile {
  width: 76px; height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  border: 1px solid rgba(225,172,85,.28);
  background:
    radial-gradient(circle at 45% 28%, rgba(255,255,255,.12), transparent 40%),
    linear-gradient(180deg, rgba(50,34,31,.78), rgba(12,9,10,.92));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 9px 18px rgba(0,0,0,.32);
}
.mailbox-reward-icon {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; position: relative;
}
.mailbox-reward-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px rgba(224,177,94,.32));
}
.mailbox-reward-icon.is-coin {
  display: block;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff2a6, #d7a043 48%, #5f3d17 78%);
}
.mailbox-reward-icon.is-art {
  border-radius: 6px;
  background: rgba(0,0,0,.18);
}
.mailbox-reward-tile strong {
  color: #ffe39a;
  font: 900 13px Arial, sans-serif;
}
.mailbox-reward-tile small {
  max-width: 68px;
  color: rgba(236,214,178,.62);
  font: 700 9px Arial, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mailbox-reward-empty {
  align-self: center;
  color: rgba(232,211,176,.42);
  font: 700 13px Arial, sans-serif;
}
.mailbox-detail-bottom {
  position: relative;
  z-index: 3;
  display: flex; align-items: end; justify-content: space-between;
  gap: 18px;
  margin: 0 calc(clamp(20px, 2.2vw, 32px) * -1);
  padding: 16px clamp(20px, 2.2vw, 32px) clamp(16px, 2vh, 20px);
  background:
    linear-gradient(180deg, rgba(7,5,6,0), rgba(7,5,6,.88) 24%, rgba(7,5,6,.96)),
    linear-gradient(90deg, rgba(9,6,7,.94), rgba(17,10,9,.86));
  border-top: 1px solid rgba(224,171,83,.16);
}
.mailbox-expire {
  color: rgba(221,78,72,.82);
  font: 700 12px Arial, sans-serif;
}
.mailbox-detail-actions {
  display: flex; align-items: center; gap: 12px;
}
.mailbox-detail-del[hidden] { display: none; }

@media (max-width: 900px) {
  .mailbox-box {
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
    min-height: 0;
  }
  .mailbox-topbar {
    height: 62px;
    padding: 0 14px;
  }
  .mailbox-resource { display: none; }
  .mailbox-content {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 12px;
  }
  .mailbox-left {
    padding-right: 0;
    border-right: 0;
  }
  .mailbox-detail {
    position: absolute;
    inset: 70px 12px 12px;
    display: none;
  }
  .mailbox-detail:not(.is-empty) {
    display: block;
    z-index: 4;
  }
  .mailbox-back { display: block; }
  .mailbox-detail-card {
    overflow: hidden;
    padding: 48px 20px 0;
  }
  .mailbox-reward-label,
  .mailbox-detail-reward {
    position: static;
  }
  .mailbox-reward-label { margin: 14px 0 10px; }
  .mailbox-detail-reward { min-height: 76px; }
  .mailbox-detail-bottom {
    margin: 18px -20px 0;
    padding: 14px 20px 18px;
  }
  .mailbox-detail-head {
    grid-template-columns: 1fr;
  }
  .mailbox-letter-art { display: none; }
}

@media (max-width: 560px) {
  .mailbox-brand { font-size: 20px; }
  .mailbox-sigil { width: 30px; height: 30px; }
  .mailbox-tabs { height: 40px; }
  .mailbox-tab { font-size: 11px; }
  .mailbox-row { height: 64px; padding: 0 10px; gap: 10px; }
  .mailbox-env { width: 42px; height: 36px; }
  .mailbox-env.has-gift { width: 42px; height: 42px; }
  .mailbox-foot { height: auto; flex-direction: column; align-items: stretch; }
  .mailbox-foot-actions { width: 100%; }
  .mailbox-claimall,
  .mailbox-delsel { flex: 1; min-width: 0; }
  .mailbox-pager { justify-content: center; }
  .mailbox-detail-bottom { flex-direction: column; align-items: stretch; }
  .mailbox-detail-actions { align-items: stretch; }
  .mailbox-detail-claim { flex: 1; min-width: 0; }
}

/* ============================================================
   SETTINGS MODAL — BGM & SFX
   ============================================================ */
.sett-modal {
  position: fixed; inset: 0; z-index: 9600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sett-modal[hidden] { display: none; }
.sett-modal, .sett-modal * { box-sizing: border-box; }

.sett-box {
  width: min(420px, 92vw);
  background:
    linear-gradient(155deg, #0e0612 0%, #07030d 100%),
    rgba(4,2,7,.96);
  border: 1px solid rgba(224,162,60,.32);
  border-radius: 10px;
  box-shadow:
    0 28px 70px rgba(0,0,0,.85),
    inset 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  font-family: "Cinzel", serif;
}

.sett-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px 13px;
  border-bottom: 1px solid rgba(224,162,60,.14);
  background: rgba(224,162,60,.04);
}

.sett-topbar-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: .18em;
  color: #e0a23c;
  text-transform: uppercase;
}

.sett-close {
  background: none; border: 0;
  color: rgba(242,230,212,.45);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 2px 6px; border-radius: 4px;
  transition: color .14s, background .14s;
}
.sett-close:hover { color: #f2e6d4; background: rgba(255,255,255,.07); }

.sett-body {
  padding: 20px 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
}

.sett-section {
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
  transition: opacity .2s;
}
.sett-section.is-off { opacity: .5; }
.sett-section.is-off .sett-vol-slider { pointer-events: none; }

.sett-sec-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .14em; color: #e0a23c;
  text-transform: uppercase;
}

.sett-row {
  display: flex; align-items: center; gap: 14px;
}

/* CSS toggle switch */
.sett-toggle {
  position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer;
}
.sett-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sett-toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  transition: background .2s, border-color .2s;
}
.sett-toggle input:checked + .sett-toggle-track {
  background: rgba(224,162,60,.38);
  border-color: rgba(224,162,60,.55);
}
.sett-toggle-track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,.45);
  transition: transform .2s, background .2s;
}
.sett-toggle input:checked + .sett-toggle-track::after {
  transform: translateX(20px);
  background: #e0a23c;
}

/* Volume slider */
.sett-vol-slider {
  flex: 1; height: 4px;
  accent-color: #e0a23c;
  cursor: pointer; background: transparent;
}

.sett-vol-pct {
  font-size: 11px; font-family: monospace;
  color: rgba(242,230,212,.5);
  width: 34px; text-align: right; flex-shrink: 0;
}
