/* Brick Seabed Base Builder - layout. Tokens (--kit-*) come from kit/kit_ui.css. Layout follows the Figma "UB ·" desktop/mobile frames. */
:root { --bg: #06233a; --text: #f4f1ea; --soft: #c9d6df; --panel: rgba(8, 28, 48, .82); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overflow: hidden; }
body.embed-mode, body.embed-mode #app { height: 100vh; height: 100dvh; }
#app { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#c:focus-visible { box-shadow: inset 0 0 0 3px var(--kit-warn); }
.panel, #cats, #assets, #hud, #tag, .chip, .ib { background: var(--panel); border: 1px solid var(--kit-line); border-radius: 14px; backdrop-filter: blur(8px); }
[hidden] { display: none !important; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--kit-warn); outline-offset: 2px; }
/* categories */
#cats { position: absolute; left: 12px; top: 12px; width: 156px; padding: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.cat { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--kit-line); background: rgba(255, 255, 255, .06); color: var(--text); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; text-align: left; }
.cat .ic { font-size: 22px; width: 28px; text-align: center; } .cat small { display: block; font-weight: 500; font-size: 10px; color: var(--soft); }
.cat[aria-pressed=true] { background: #e8b90e; color: #1a1400; border-color: #ffd93a; } .cat[aria-pressed=true] small { color: #4a3d00; }
.cat:disabled { opacity: .5; cursor: default; }
/* assets */
#assets { position: absolute; left: 176px; top: 12px; width: 220px; max-height: calc(100% - 100px); overflow: auto; padding: 8px; z-index: 6; font-size: 12.5px; }
#assets .slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; } #assets .tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.slot { min-height: 56px; border-radius: 10px; border: 1px solid var(--kit-line); background: rgba(255, 255, 255, .07); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; font: 600 11px Inter, system-ui, sans-serif; }
.slot.sm { min-height: 44px; padding: 2px; font-size: 10px; } .slot .ic { font-size: 20px; line-height: 1; }
.slot.on, .slot[aria-pressed=true] { border-color: var(--kit-accent); box-shadow: 0 0 0 2px var(--kit-accent) inset; background: rgba(70, 166, 255, .2); }
#assets .cols { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 8px 0 4px; } #assets .kit-col { aspect-ratio: 1; min-width: 18px; padding: 0; }
.note { color: var(--soft); font-size: 12px; margin: 6px 0 0; line-height: 1.4; } .mono { font: 500 11.5px/1.45 'JetBrains Mono', ui-monospace, monospace; margin: 4px 0; }
.hullrow { margin-top: 8px; display: grid; gap: 4px; } .hullrow label, .rw { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 12.5px; margin: 6px 0; } .hullrow input, .rw input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: #46a6ff; min-height: 28px; }
.rw input[type=checkbox] { width: 22px; height: 22px; accent-color: #46a6ff; justify-self: end; }
/* top right */
#topr { position: absolute; right: 12px; top: 10px; width: 332px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 6; max-height: calc(100% - 80px); }
#tbtns { display: flex; gap: 8px; } .ib { width: 48px; height: 48px; font-size: 22px; color: var(--text); cursor: pointer; display: grid; place-items: center; } .ib[aria-pressed=true] { border-color: var(--kit-accent); background: rgba(70, 166, 255, .3); }
#chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; } .chip { padding: 6px 8px; min-width: 0; } .chip small { display: block; color: var(--soft); font-size: 10px; white-space: nowrap; } .chip b { font-size: 14px; white-space: nowrap; }
.panel { padding: 10px 12px; font-size: 13px; width: 100%; position: relative; } .panel h2 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel .x { position: absolute; right: 4px; top: 2px; width: 36px; height: 36px; background: none; border: 0; color: var(--soft); font-size: 22px; cursor: pointer; } #dash h2 { padding-right: 30px; }
#dash { overflow: auto; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); } #dash select { background: #0c2a44; color: var(--text); border: 1px solid var(--kit-line); border-radius: 8px; min-height: 30px; }
.m { margin: 8px 0; } .m span { display: block; font-size: 12px; color: var(--soft); } .m em { display: block; font: normal 11px 'JetBrains Mono', monospace; margin-top: 2px; } .track { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .14); margin-top: 3px; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; background: #ffcf3a; border-radius: 4px; transition: width .25s; } .fill.warn { background: #ff9d3a; } .fill.bad { background: #ff5a4f; }
#vMsg.ok { color: #6fe08a; font-weight: 700; } #vMsg.bad { color: #ff7a6e; font-weight: 700; }
details { border: 1px solid var(--kit-line); border-radius: 10px; margin: 6px 0; padding: 4px 8px; } summary { cursor: pointer; font-weight: 700; min-height: 30px; display: flex; align-items: center; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; } .seg button { min-width: 40px; min-height: 36px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--kit-line); background: rgba(255, 255, 255, .07); color: var(--text); font: 600 12px Inter, system-ui, sans-serif; cursor: pointer; } .seg button[aria-pressed=true] { border-color: var(--kit-accent); background: rgba(70, 166, 255, .3); }
.btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0; font-size: 12px; } dt { color: var(--soft); } dd { margin: 0; font-family: 'JetBrains Mono', ui-monospace, monospace; text-align: right; }
.sf { padding: 6px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; margin: 6px 0; } .sf.ok { background: rgba(95, 209, 122, .18); color: #8ff0a6; } .sf.bad { background: rgba(255, 90, 79, .2); color: #ff9a90; }
#sN.ok { color: #6fe08a; font-weight: 700; }
#sunp { position: absolute; top: 58px; right: 0; width: 300px; z-index: 8; }
/* card + sub */
#card { position: absolute; right: 12px; top: 118px; width: 332px; max-height: calc(100% - 200px); overflow: auto; z-index: 7; } #subp { position: absolute; left: 412px; bottom: 76px; width: 290px; max-height: calc(100% - 110px); overflow: auto; z-index: 7; } #card h3 { margin: 0 0 4px; font-size: 15px; padding-right: 30px; }
/* bar */
#bar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 7; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
#bar .kit-btn { padding: 6px 10px; } #bar .kit-btn:disabled { opacity: .4; }
#bar #undo .lb, #bar #redo .lb, #bar #help .lb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#bar .seg { background: var(--panel); border: 1px solid var(--kit-line); border-radius: 12px; padding: 3px; backdrop-filter: blur(8px); } #clock { background: var(--panel); border: 1px solid var(--kit-line); border-radius: 12px; padding: 12px 12px; font: 600 12.5px 'JetBrains Mono', monospace; }
#hud { position: absolute; left: 12px; bottom: 70px; padding: 5px 9px; font: 500 11.5px 'JetBrains Mono', monospace; z-index: 4; pointer-events: none; }
#tag { position: fixed; z-index: 30; padding: 6px 10px; font: 600 12px Inter, system-ui, sans-serif; max-width: 300px; pointer-events: none; } #tag.ok { border-color: #5fd17a; } #tag.bad { border-color: #ff6a5c; color: #ffb0a8; }
#live { position: absolute; left: -9999px; }
#load { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); font-size: 15px; z-index: 30; text-align: center; }
.spin { width: 34px; height: 34px; border: 4px solid rgba(255, 255, 255, .2); border-top-color: #46a6ff; border-radius: 50%; margin: 0 auto 12px; animation: sp 1s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } }
#dlg { position: fixed; inset: 0; background: rgba(4, 12, 22, .7); z-index: 80; display: grid; place-items: center; padding: 14px; }
#dlg .card { position: relative; width: min(760px, 100%); max-height: calc(100dvh - 28px); overflow: auto; background: #0b2238; border: 1px solid var(--kit-line); border-radius: 16px; padding: 18px 20px; font-size: 14px; line-height: 1.5; }
#dlg h2 { margin: 0 0 10px; font-size: 18px; } #dlg h3 { margin: 12px 0 4px; font-size: 14px; } #dlg .x { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; background: none; border: 0; color: var(--soft); font-size: 26px; cursor: pointer; }
#dlg code, #dlg .eq { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; background: rgba(255, 255, 255, .07); padding: 1px 5px; border-radius: 5px; } #dlg .eq { display: block; padding: 6px 10px; margin: 6px 0; overflow-x: auto; }
#dlg table { border-collapse: collapse; width: 100%; font-size: 12px; display: block; overflow-x: auto; } #dlg td, #dlg th { border-bottom: 1px solid var(--kit-line); padding: 4px 6px; text-align: left; } .pass { color: #5fd17a; } .fail { color: #ff6a5c; }
#dlg select { background: #0c2a44; color: var(--text); border: 1px solid var(--kit-line); border-radius: 8px; min-height: 34px; } #dlg label { font-size: 13px; }
.tour { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); width: min(430px, calc(100% - 24px)); background: #0b2238; border: 2px solid var(--kit-accent); border-radius: 14px; padding: 12px 14px; z-index: 70; font-size: 14px; } .tour .btns { margin-bottom: 0; }
@media (max-width: 640px) {
  #cats { left: 6px; right: 6px; top: auto; bottom: 62px; width: auto; flex-direction: row; overflow-x: auto; padding: 5px; gap: 5px; scrollbar-width: none; }
  .cat { flex: 0 0 auto; flex-direction: column; gap: 0; min-height: 50px; min-width: 62px; padding: 2px 6px; text-align: center; font-size: 10.5px; } .cat .ic { font-size: 20px; } .cat small { display: none; }
  #assets { left: 6px; right: 6px; top: auto; bottom: 126px; width: auto; max-height: 27dvh; } #assets .slots { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
  #topr { right: 6px; top: 6px; width: min(260px, calc(100% - 12px)); } .ib { width: 44px; height: 44px; } #chips { grid-template-columns: repeat(2, 1fr); } .chip b { font-size: 13px; }
  #dash, #card, #subp { position: fixed; left: 6px; right: 6px; width: auto; bottom: 126px; top: auto; max-height: 50dvh; z-index: 12; } #sunp { width: 100%; }
  #bar { left: 4px; right: 4px; bottom: 6px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; } #bar .kit-btn, #bar .seg, #clock { flex: 0 0 auto; } #bar .kit-btn .lb { font-size: 11px; }
  #hud { left: 6px; bottom: auto; top: 6px; font-size: 10px; max-width: 120px; } .tour { bottom: 190px; }
}
@media (prefers-reduced-motion: reduce) { .spin, .fill { animation: none; transition: none; } }
