/* ---------- the Game modes page (the soundboard's on the home screen now: hoard-home.css) ---------- */
#modes { display: none; position: fixed; inset: 0; z-index: 50; overflow-y: auto; padding: 104px 16px 90px; background: radial-gradient(ellipse at top, #1d2a12, #0b1006 70%); }
#modes.open { display: block; }
:is(#soundboard, #modes) .sbhead { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto 16px; padding: 10px 14px; border-radius: 14px; background: rgba(11, 16, 6, 0.85); border: 1px solid rgba(242, 182, 50, 0.3); }
:is(#soundboard, #modes) .sbhead h2 { margin: 0; font-family: var(--f-ui); color: #f2b632; font-size: 22px; }
:is(#soundboard, #modes) .sbhead .sbsub { flex: 1; opacity: 0.7; font-size: 13px; }
#modes .sbhead .shopclose { position: static; flex: none; }
@media (max-width: 640px) { #modes { padding-top: 120px; } :is(#soundboard, #modes) .sbhead .sbsub { display: none; } }
body.guest #jukebox, body.guest #soundboard, body.guest #sbbtn { display: none !important; }
/* ---------- the home page: what's on for you ---------- */
#homeboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; max-width: 1100px; margin: 4px auto 24px; padding: 0 16px; }
#homeboard .hbcard { padding: 14px 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(36, 30, 14, 0.9), rgba(18, 14, 8, 0.9)); border: 1px solid rgba(242, 182, 50, 0.25); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
#homeboard .hbcard.click { cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
#homeboard .hbcard.click:hover { transform: translateY(-2px); border-color: rgba(242, 182, 50, 0.6); }
#homeboard h3 { margin: 0 0 8px; font-size: 16px; color: #f2b632; }
#homeboard p { margin: 0; font-size: 13px; opacity: 0.85; line-height: 1.45; }
#homeboard .hbsound { background: linear-gradient(160deg, rgba(60, 90, 20, 0.9), rgba(24, 34, 10, 0.95)); }
#homeboard .hbgo { display: inline-block; margin-top: 8px; font-family: var(--f-ui); color: #ffd23c; font-size: 13px; }
#homeboard .hbrow { display: grid; gap: 3px; margin: 6px 0; font-size: 13px; }
#homeboard .hbrow.done { opacity: 0.6; }
#homeboard .hbbar { display: block; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
#homeboard .hbbar b { display: block; height: 100%; background: #8fbf3a; }
/* ---------- the goblin, gutted ---------- */
#goblin.sad .mascot { filter: saturate(0.35) brightness(0.85); transform: rotate(-8deg); }
#goblin.left.sad .mascot { transform: scaleX(-1) rotate(-8deg); }
#goblin.sad .bubble-actions, #goblin.sad .reward:empty { display: none; }
#goblin .reward:empty { display: none; }
/* ---------- errands in Challenges ---------- */
#challist .quest.errand { position: relative; }
#challist .qabandon { margin-top: 6px; padding: 3px 10px; font-size: 12px; }
#challist .quest.none { list-style: none; padding: 12px; opacity: 0.8; text-align: center; }

/* ---------- the rail: home, and every mode, on every screen ---------- */
#navrail { position: fixed; left: 10px; top: 50%; transform: translateY(-50%); z-index: 95; display: none; flex-direction: column; gap: 4px; padding: 6px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(30, 40, 16, 0.95), rgba(10, 14, 6, 0.95)); border: 1px solid rgba(154, 168, 184, 0.45); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55); }
#navrail.show { display: flex; }
#navrail .nr-btn { position: relative; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px 4px; border: 0; border-radius: 10px; background: transparent; color: #e8e0c0; cursor: pointer; }
#navrail .nr-btn:hover { background: rgba(154, 168, 184, 0.18); }
#navrail .nr-btn.on { background: rgba(242, 182, 50, 0.22); box-shadow: inset 0 0 0 1px rgba(242, 182, 50, 0.6); cursor: default; }
#navrail .nr-btn.on .nr-l { color: #ffd23c; }
#navrail .nr-home { background: rgba(242, 182, 50, 0.14); margin-bottom: 4px; }
#navrail .nr-home .nr-l { color: #ffd23c; }
#navrail .nr-i { display: grid; place-items: center; width: 26px; height: 26px; font-size: 20px; line-height: 1; }
#navrail .nr-i svg { width: 26px; height: 26px; }
#navrail .nr-l { font-size: 9.5px; line-height: 1.1; letter-spacing: 0.02em; white-space: nowrap; }
#navrail .nr-more { margin-top: 4px; }
#navmore { position: fixed; left: 76px; top: 50%; transform: translateY(-50%); z-index: 96; display: none; width: min(380px, calc(100vw - 92px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 12px;
  border-radius: 16px; background: linear-gradient(180deg, rgba(36, 30, 14, 0.98), rgba(14, 12, 6, 0.98)); border: 1px solid rgba(242, 182, 50, 0.45); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
#navmore.open { display: block; }
#navmore .nm-home { width: 100%; padding: 8px; margin-bottom: 6px; border-radius: 10px; border: 1px solid rgba(242, 182, 50, 0.5); background: rgba(242, 182, 50, 0.15); color: #ffd23c; font-family: var(--f-ui); cursor: pointer; }
#navmore .nm-gl { margin: 8px 2px 4px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #8fbf3a; }
#navmore .nm-row { display: flex; flex-wrap: wrap; gap: 6px; }
#navmore .nm-tile { width: 66px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; border: 1px solid rgba(154, 168, 184, 0.3); background: rgba(0, 0, 0, 0.25); color: #e8e0c0; cursor: pointer; }
#navmore .nm-tile:hover { border-color: rgba(242, 182, 50, 0.6); background: rgba(242, 182, 50, 0.1); }
#navmore .nr-i svg { width: 26px; height: 26px; }
#navmore .nr-l { font-size: 10px; }
/* short or narrow screens: just Home and More, tucked into the bottom-left corner */
@media (max-height: 640px), (max-width: 700px) {
  #navrail { top: auto; bottom: 12px; transform: none; flex-direction: row; padding: 4px; }
  #navrail .nr-quick { display: none !important; }
  #navrail .nr-home { margin: 0 4px 0 0; }
  #navrail .nr-more { margin: 0; }
  #navmore { left: 10px; top: auto; bottom: 74px; transform: none; width: calc(100vw - 20px); max-height: calc(100vh - 100px); }
}
@media (max-height: 640px), (max-width: 700px) { body.covered #liveauc.open { bottom: 76px; } }
/* wide screens: every screen starts to the right of the rail */
@media (min-width: 701px) and (min-height: 641px) {
  body:has(#navrail.show) :is(#modes, .gamewin, #shop, #inventory, #trade, #duel, #skills, #tickhist, #catpick, #challenges, #witch, #econ, #loanwin, #warplan, #casino, #village, #house, #market, #blackjack, #poker, #roulette, #zombie:not(.playing), #scopes:not(.playing)) { padding-left: 76px; }
}

/* the login prompt, the loading cauldron and the error message sit across the home page */
#homeboard > .gate, #homeboard > .loader, #homeboard > .dead { grid-column: 1 / -1; }

/* following someone, or walking about: a bar across the top of the village map */
#vilfollow { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: none; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 32px); padding: 6px 10px; border-radius: 14px; background: rgba(14, 18, 8, 0.9); border: 1px solid rgba(242, 182, 50, 0.5); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); font-size: 13px; }
#vilfollow.show { display: flex; }
#vilfollow .vfname, #vilfollow .vfwalk { color: #ffd23c; }
#vilfollow .chip { padding: 3px 9px; font-size: 12px; }
#walkbtn.on { background: rgba(242, 182, 50, 0.25); border-color: #f2b632; }
.vwalker { cursor: pointer; }
.cauldup { margin: 4px 0 8px; }

