/* hub.css — title, hub, panels, market */
.title-ui { position: fixed; inset: 0; pointer-events: none; }
.title-logo { position: absolute; left: 50%; top: 4%; width: 70%; max-width: 70%; height: 32%; transform: translateX(-50%); display: flex; justify-content: center; align-items: center; animation: logoDrop .7s cubic-bezier(.3,1.5,.5,1) both; }
.title-logo img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 4px 0 rgba(0,0,0,.5)); animation: floaty 3s ease-in-out .8s infinite; }
.title-prompt { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; font-size: max(14px, calc(var(--u) * 1.3)); color: #f4e2b0; animation: pulse 1.4s ease-in-out infinite;
  text-shadow: 2px 0 var(--outline), -2px 0 var(--outline), 0 2px var(--outline), 0 -2px var(--outline), 2px 2px 0 var(--outline); }
.title-trophy { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; padding: 8px; pointer-events: auto; cursor: pointer; background: rgba(30,32,40,.7); border: 3px solid var(--line-dark); opacity: .8; transition: opacity .15s, transform .08s; }
.title-trophy:hover { opacity: 1; } .title-trophy:active { transform: scale(.92); }
.title-trophy svg { width: 100%; height: 100%; display: block; }
@keyframes logoDrop { 0% { transform: translate(-50%, -140%); opacity: 0; } 70% { transform: translate(-50%, 6%); opacity: 1; } 100% { transform: translate(-50%, 0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.hub-ui { position: fixed; inset: 0; pointer-events: none; }
.hub-ui > * { pointer-events: auto; }
.hub-bar { position: absolute; left: 76px; top: 10px; display: flex; align-items: center; gap: calc(var(--u) * 1.2); padding: 4px 12px; min-height: 44px; font-size: max(14px, calc(var(--u) * 1.1)); }
.hub-bar.panel { animation: pop .22s cubic-bezier(.3,1.6,.5,1); }
.hub-chips b { font-weight: 400; color: #ffe6a8; text-shadow: 2px 2px 0 var(--outline); }
.hub-chips.bump { animation: bump .3s cubic-bezier(.3,1.8,.5,1); }
.hub-clock { color: var(--dim); font-size: max(12px, calc(var(--u) * .95)); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.hub-map { position: absolute; left: 12px; top: 64px; display: flex; gap: 8px; align-items: center; width: min(32%, 300px); padding: 8px; }
.hm-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: max(12px, calc(var(--u) * .95)); }
.hm-t b { font-weight: 400; font-size: max(14px, calc(var(--u) * 1.15)); color: #f4e2b0; }
.hm-t small { color: var(--dim); font-size: max(12px, calc(var(--u) * .85)); overflow-wrap: anywhere; }
.hc-img { width: 48px; height: 60px; flex: none; image-rendering: pixelated; object-fit: contain; }
.hub-map .hc-img { width: 44px; height: 55px; }
.dark { filter: brightness(0) opacity(.5); }
.hub-menu { position: absolute; right: 76px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; width: clamp(130px, 19vw, 240px); animation: pop .25s cubic-bezier(.3,1.6,.5,1); }
.btn.big { min-height: clamp(44px, 7.4vh, 60px); font-size: max(15px, calc(var(--u) * 1.15)); flex-direction: column; gap: 0; line-height: 1.1; padding-top: 2px; padding-bottom: 2px; }
.btn.big small { font-size: max(12px, calc(var(--u) * .8)); color: #f4e2b0; min-height: 0; }
.btn.big small:empty { display: none; }
.btn.focus { outline: 3px solid #ffe6a8; outline-offset: 2px; }
.btn.off { cursor: not-allowed; }

.hub-ov { position: fixed; inset: 0; background: rgba(10,11,15,.55); display: flex; align-items: center; justify-content: center; z-index: 5; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.hub-panel { width: min(90%, 940px); max-height: 86%; display: flex; flex-direction: column; padding: 10px 12px; font-size: max(14px, var(--u)); }
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.hub-head h2 { margin: 0; }
.hub-x { width: 44px; padding: 0; font-size: 18px; }
.hub-body { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; padding: 4px 6px 0 0; scrollbar-width: thin; scrollbar-color: var(--line-dark) var(--outline); }
.hub-body::-webkit-scrollbar { width: 10px; } .hub-body::-webkit-scrollbar-track { background: var(--outline); } .hub-body::-webkit-scrollbar-thumb { background: var(--line-dark); border: 2px solid var(--outline); }
.hub-body small, .dim { color: var(--dim); font-size: max(12px, calc(var(--u) * .85)); }
.hub-body h3 { margin: 8px 0 4px; font-weight: 400; color: #f4e2b0; font-size: max(14px, calc(var(--u) * 1.05)); }
.m-empty { text-align: center; color: var(--dim); padding: 20px 0; }
.up { color: #86b893; } .down { color: #d0745c; }
u { text-decoration: none; font-size: .8em; }

.hcards { display: flex; gap: 8px; }
.hcard { flex: 1; min-width: 0; text-align: left; font-family: var(--font); font-size: max(12px, calc(var(--u) * .9)); color: var(--ink); background: var(--panel2); border: 3px solid var(--line-dark); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: transform .08s, filter .12s; }
.hcard:hover, .hcard.focus { filter: brightness(1.15); } .hcard:active { transform: scale(.98); }
.hcard.sel { border-color: var(--gold); background: #32333a; box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px var(--gold); }
.hc-top { display: flex; gap: 6px; align-items: center; } .hc-top div { display: flex; flex-direction: column; min-width: 0; } .hc-top b { font-weight: 400; font-size: max(14px, calc(var(--u) * 1.1)); color: #f4e2b0; }
.hc-row { display: flex; align-items: center; gap: 4px; } .hc-row > span { width: 3.2em; color: var(--dim); flex: none; } .hc-row em { font-style: normal; width: 2.4em; text-align: right; }
.hc-s { color: var(--dim); overflow-wrap: anywhere; line-height: 1.25; } .hc-s b { font-weight: 400; color: var(--ink); }
.bar { flex: 1; height: 10px; background: var(--outline); border: 2px solid var(--line-dark); } .bar i { display: block; height: 100%; background: var(--jade); } .bar.sp i { background: var(--gold); }
.dice { display: flex; gap: 2px; flex-wrap: wrap; }
.die { width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px; box-sizing: border-box; background: #e8e0cc; border: 2px solid var(--outline); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 1px; }
.die i { display: block; } .die i.pip { background: #1b1d23; border-radius: 50%; margin: 1px; }
.lo { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; } .lo h3 { margin: 0; }
.slots, .cells { display: flex; gap: 6px; flex-wrap: wrap; }
.cell { position: relative; width: 52px; height: 52px; min-width: 44px; padding: 0; background: #20232b; border: 3px solid var(--line-dark); cursor: pointer; font-family: var(--font); color: var(--ink); transition: transform .08s, filter .12s; }
.cell:hover, .cell.focus { filter: brightness(1.25); } .cell:active { transform: scale(.94); } .cell.on { box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px var(--gold); }
.cell img { width: 100%; height: 100%; display: block; }
.cell i { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 12px; text-shadow: 1px 1px 0 var(--outline), -1px -1px 0 var(--outline), 1px -1px 0 var(--outline), -1px 1px 0 var(--outline); }
.cell u { position: absolute; left: 2px; top: 0; font-size: 12px; text-shadow: 1px 1px 0 var(--outline); }
.cell .cp { position: absolute; left: 2px; bottom: 0; font-style: normal; font-size: 11px; color: #ffe6a8; text-shadow: 1px 1px 0 var(--outline); }
.cell.slot.empty { border-style: dashed; font-size: 22px; color: var(--dim); cursor: default; }
.cells.big .cell { width: 62px; height: 62px; }
.prep-low { display: flex; gap: 12px; align-items: flex-start; }
.prep-low > .lo { flex: 0 0 38%; min-width: 0; }
.prep-low > .shoprow { flex: 1; min-width: 0; }
.shoprow { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.srow, .m-row { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 2px solid var(--line-dark); padding: 4px 8px; }
.simg { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; flex: none; }
.m-name { display: flex; flex-direction: column; min-width: 0; flex: 1; } .m-name b { font-weight: 400; overflow-wrap: anywhere; } .m-name small { overflow-wrap: anywhere; }
.m-right { display: flex; gap: 6px; align-items: center; flex: none; }
.m-row .ricon { width: 44px; height: 44px; flex: none; }
.hub-ui:has(.hub-ov) > :not(.hub-ov) { visibility: hidden; }
.hub-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 6px; margin-top: 6px; border-top: 2px solid var(--line-dark); }
.warn { color: #e0a080 !important; flex: 1; font-size: max(12px, calc(var(--u) * .9)) !important; }
.hub-foot .btn.big { flex-direction: row; min-width: 120px; }

.tot { margin-bottom: 6px; color: #f4e2b0; }
.m-sell { display: flex; gap: 10px; align-items: flex-start; } .m-sell > .cells { flex: 1; align-content: flex-start; }
.m-pick { flex: 0 0 42%; display: flex; flex-direction: column; gap: 6px; background: var(--panel2); border: 2px solid var(--line-dark); padding: 8px; }
.m-pick p { margin: 0; color: var(--dim); font-size: max(12px, calc(var(--u) * .9)); overflow-wrap: anywhere; }
.det { display: flex; gap: 8px; align-items: center; } .det .ricon { width: 56px; height: 56px; }
.m-btns { display: flex; gap: 6px; flex-wrap: wrap; } .m-btns .btn { flex: 1; }
.m-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.m-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.m-tab.on { background: #8a6a2c; border-color: #f6dc9c; }
.m-chips { color: #ffe6a8; }
.m-box { display: flex; flex-direction: column; gap: 4px; } .m-box .m-sell { align-items: flex-start; }
.m-tag { font-size: 12px; padding: 1px 6px; border: 2px solid; white-space: nowrap; } .m-tag.good { color: #86b893; border-color: #86b893; } .m-tag.bad { color: #d0745c; border-color: #d0745c; }
.m-step { display: flex; align-items: center; gap: 8px; justify-content: space-between; } .m-price { display: flex; flex-direction: column; align-items: center; color: #ffe6a8; }
.m-hint { overflow-wrap: anywhere; }
.m-act { min-width: 80px; }

.prog { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .prog .bar { max-width: 300px; }
.cdx { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.cdx-c { display: flex; gap: 6px; background: var(--panel2); border: 3px solid var(--line-dark); padding: 4px; min-width: 0; } .cdx-c > div:last-child { display: flex; flex-direction: column; min-width: 0; } .cdx-c b { font-weight: 400; }
.cdx-c .ricon { width: 44px; height: 44px; } .cdx-c small { overflow-wrap: anywhere; }
.brow { display: flex; gap: 8px; } .bcard { flex: 1; display: flex; flex-direction: column; align-items: center; background: var(--panel2); border: 2px solid var(--line-dark); padding: 4px; text-align: center; } .bcard b { font-weight: 400; }
.help { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; line-height: 1.35; } .help li::marker { color: var(--gold); }
@media (max-height: 420px) { .hcard .hc-s:nth-last-child(2) { display: none; } }
