/* The hub (inde2.html, src/ui/hub/): a client bar on top, the Home and Play views, the social
   column. The game's own look (panels, copper, teal, the themes); only the layout is new. */

:root { --hub-bar-h: 60px; --hub-bottom-h: 0px; }

/* ------------------------------------------------------------ the client bar */
.hub-bar {
  position: fixed; z-index: 40; left: 0; right: 0; top: 0;
  height: calc(var(--hub-bar-h) + var(--safe-t)); padding: var(--safe-t) max(10px, var(--safe-r)) 0 max(10px, var(--safe-l));
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(18, 14, 22, 0.97), rgba(29, 23, 36, 0.94));
  border-bottom: 3px solid #000; box-shadow: 0 2px 0 var(--copper-dk), 0 8px 18px rgba(0, 0, 0, 0.45);
}
.hub-bar[hidden], .hub-bottom[hidden] { display: none; }
.hub-brand .t1 { font-family: var(--font-title); font-size: 14px; letter-spacing: 2px; color: var(--copper-hi); text-shadow: 0 2px 0 var(--copper-dk); }
/* PLAY: the big angled button, as in a game client */
.hub-play {
  position: relative; min-width: 128px; height: 42px; padding: 0 22px;
  font-family: var(--font-title); font-size: 15px; letter-spacing: 2px; color: #241405;
  background: linear-gradient(180deg, var(--copper-hi), var(--copper)); border: 3px solid #000;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  box-shadow: inset 0 -4px 0 var(--copper-dk), inset 0 3px 0 rgba(255, 246, 220, 0.4);
}
.hub-play:hover, .hub-play:focus-visible, .hub-play.on { filter: brightness(1.12); }
.hub-play.on { background: linear-gradient(180deg, #ffe48a, var(--gold)); }
.hub-tabs { display: flex; gap: 2px; height: 100%; align-items: stretch; margin-left: 6px; }
.hub-tab {
  height: 100%; min-height: 0; padding: 0 12px; gap: 6px; border: 0; border-radius: 0;
  background: none; box-shadow: none; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 3px solid transparent;
}
.hub-tab:hover, .hub-tab:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.hub-tab.on { color: var(--gold); border-bottom-color: var(--gold); background: linear-gradient(0deg, rgba(245, 197, 66, 0.14), transparent); }
.hub-tab canvas, .hub-tab img { opacity: 0.8; }
.hub-tab.on canvas, .hub-tab.on img { opacity: 1; }
.hub-bar .grow { flex: 1; }
.hub-bar .currencies { flex-wrap: nowrap; }
.hub-me {
  display: grid; grid-template-columns: 40px auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  min-width: 150px; max-width: 200px; height: 46px; padding: 3px 10px 3px 3px; text-align: left;
  background: var(--panel-2); border: 2px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 246, 220, 0.12);
}
.hub-me .hub-pic { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; background: #120e16; border: 2px solid var(--copper-dk); overflow: hidden; }
.hub-me .hub-pic canvas { width: 34px; height: 34px; image-rendering: pixelated; }
.hub-me .hub-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.hub-me .hub-who b { font-size: var(--fs-xs); color: var(--text); }
.hub-me .hub-who small { font-size: 11px; color: var(--muted); }
.hub-me .hub-xp { grid-column: 2; height: 4px; background: #000; overflow: hidden; }
.hub-me .hub-xp i { display: block; height: 100%; background: var(--teal); }
.hub-tools { display: flex; gap: 4px; }

/* the screens sit under the bar (and on phones above the bottom tabs) */
.hub-bar-on #app > .screen { top: calc(var(--safe-t) + var(--hub-bar-h)); bottom: calc(var(--safe-b) + var(--hub-bottom-h)); }
.hub-bar-on .screen-head .currencies { display: none; }
.hub-bar-on .vignette::after { top: var(--hub-bar-h); }

/* ------------------------------------------------------------ the hub screen */
.screen-menu.hub { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; padding: 14px; overflow: hidden; }
.hub-main { min-width: 0; min-height: 0; overflow-y: auto; padding-right: 4px; }
.hub-social { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.hub-side .h2 { margin-bottom: 6px; }
.hub-side .btn.block { margin-top: 8px; }
.hub-version { margin-top: auto; text-align: right; }

/* Home: the featured banner */
.hub-home { display: flex; flex-direction: column; gap: 14px; }
.hub-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: center; min-height: 240px; padding: 22px 24px;
  background: radial-gradient(ellipse at 80% 40%, rgba(200, 105, 46, 0.28), transparent 60%), linear-gradient(135deg, rgba(29, 23, 36, 0.96), rgba(18, 14, 22, 0.92)); }
.hub-kicker { font-size: var(--fs-xs); letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.hub-title { margin: 0 0 8px; font-family: var(--font-title); font-size: clamp(18px, 2.4vw, 28px); line-height: 1.2; color: var(--copper-hi); text-shadow: 0 3px 0 var(--copper-dk); }
.hub-sub { margin: 0 0 16px; color: var(--text); max-width: 56ch; }
.hub-cta { min-width: 180px; }
.hub-hero-art { text-align: center; }
.hub-faces { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hub-faces canvas { width: 76px; height: 76px; image-rendering: pixelated; background: radial-gradient(circle at 50% 38%, #3e3448, #1d1724 75%); border: 3px solid #000; box-shadow: 0 0 0 2px var(--copper-dk); }
.hub-faces canvas:nth-child(odd) { transform: translateY(-8px); }

/* Home: today's cards */
.hub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.hub-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 130px; padding: 12px 14px; text-align: left; color: var(--text); font: inherit; }
button.hub-card { cursor: pointer; }
button.hub-card:hover, button.hub-card:focus-visible { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gold), 0 8px 16px rgba(0, 0, 0, 0.4); }
.hub-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--teal); text-transform: uppercase; letter-spacing: 1px; font-size: var(--fs-xs); }
.hub-card-head img, .hub-card-head canvas { width: 20px; height: 20px; image-rendering: pixelated; }
.hub-big { font-family: var(--font-num); font-size: 34px; line-height: 1; }
.hub-quest { width: 100%; }
.hub-card .btn { margin-top: auto; }

/* Play: the lobby */
.hub-lobby { display: flex; flex-direction: column; gap: 8px; }
.hub-kind { align-self: flex-start; margin: 10px 0 2px; padding: 3px 10px; font-size: var(--fs-xs); letter-spacing: 2px; text-transform: uppercase; color: var(--teal);
  background: rgba(18, 14, 22, 0.88); border: 2px solid #000; border-left: 4px solid var(--teal); }
.hub-lobby > .row .hub-title { padding: 2px 12px; background: rgba(18, 14, 22, 0.8); border: 2px solid #000; }
.hub-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.hub-mode { position: relative; display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 12px 14px; text-align: left; color: var(--text); font: inherit; cursor: pointer;
  border-left: 5px solid var(--copper); transition: transform 0.1s, box-shadow 0.1s; }
.hub-mode.adventure { border-left-color: var(--team-red); }
.hub-mode.daily { border-left-color: var(--gold); }
.hub-mode.learn { border-left-color: var(--teal); }
.hub-mode:hover, .hub-mode:focus-visible { transform: translateX(3px); box-shadow: 0 0 0 2px var(--gold), 0 8px 16px rgba(0, 0, 0, 0.4); outline: none; }
.hub-mode-ico { flex-shrink: 0; width: 52px; height: 52px; display: grid; place-items: center; background: #120e16; border: 2px solid #000; box-shadow: inset 0 0 0 2px rgba(255, 246, 220, 0.08); }
.hub-mode-ico canvas, .hub-mode-ico img { width: 34px; height: 34px; image-rendering: pixelated; }
.hub-mode-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hub-mode-text b { font-size: var(--fs-sm, 14px); color: var(--copper-hi); text-transform: uppercase; letter-spacing: 1px; }
.hub-mode-text small { font-size: 12px; line-height: 1.3; color: var(--muted); }
.hub-mode.mode-closed { filter: grayscale(0.8) brightness(0.7); }

/* ------------------------------------------------------------ narrower screens */
@media (max-width: 1500px) {
  .hub-brand { display: none; }
}
@media (max-width: 1280px) {
  .hub-tab .lbl { display: none; }
  .hub-tab { padding: 0 12px; }
}
@media (max-width: 1100px) {
  .screen-menu.hub { grid-template-columns: minmax(0, 1fr); }
  .hub-social { display: none; }
}
.hub-bottom { display: none; }
@media (max-width: 760px) {
  :root { --hub-bar-h: 52px; --hub-bottom-h: 64px; }
  .hub-tabs, .hub-tools > :not(:last-child), .hub-me .hub-who, .hub-me .hub-xp { display: none; }
  .hub-me { min-width: 0; width: 46px; padding: 3px; grid-template-columns: 40px; }
  .hub-play { display: none; }
  .hub-bar { gap: 6px; }
  .hub-bar .currencies .cur { padding: 2px 6px; }
  .hub-bottom {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--hub-bottom-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 2px;
    background: linear-gradient(0deg, rgba(18, 14, 22, 0.98), rgba(29, 23, 36, 0.95)); border-top: 3px solid #000; box-shadow: 0 -2px 0 var(--copper-dk);
  }
  .hub-btab { flex-direction: column; gap: 2px; height: 58px; min-height: 0; padding: 4px 2px; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: 10px; }
  .hub-btab.on { color: var(--gold); }
  .hub-bplay { flex-direction: column; gap: 2px; height: 70px; margin-bottom: 4px; padding: 4px; font-family: var(--font-title); font-size: 10px; letter-spacing: 1px; color: #241405;
    background: linear-gradient(180deg, var(--copper-hi), var(--copper)); border: 3px solid #000; border-radius: 50% 50% 8px 8px; box-shadow: inset 0 -4px 0 var(--copper-dk); }
  .hub-bplay.on { background: linear-gradient(180deg, #ffe48a, var(--gold)); }
  .screen-menu.hub { padding: 10px; }
  .hub-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 16px; }
  .hub-faces canvas { width: 52px; height: 52px; }
  .hub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-modes { grid-template-columns: minmax(0, 1fr); }
  .hub-mode { min-height: 62px; padding: 8px 10px; }
  .hub-mode-ico { width: 42px; height: 42px; }
  .hub-mode-ico canvas, .hub-mode-ico img { width: 28px; height: 28px; }
  .hub-bar-on .patrol-widget { bottom: calc(var(--hub-bottom-h) + 10px); }
}
