/* ---------------- Panel ----------------
   The frame art (ui-panel / ui-button) is cropped at load by src/uiart.js and used as a true 9-slice:
   the corners keep their size, only the edges' middles stretch. Before that (or without the art) the
   same shapes are drawn in CSS. */
.stock-val { font-size: 22px !important; min-width: 56px; text-align: right; padding-right: 6px; }
.hint.warn { color: #d8124f; font-weight: 800; }
.stock-tip { margin: -3px 0 3px; }
#panel { position: absolute; left: 4px; right: 4px; bottom: calc(4px + env(safe-area-inset-bottom)); top: var(--panelTop); z-index: 4;
  border: 4px solid var(--navy); border-radius: 20px; background: var(--cream); padding: 10px 8px 6px;
  display: flex; flex-direction: column; animation: slideUp 0.35s cubic-bezier(.2, 1.4, .4, 1); }
.art-panel #panel, .art-panel .banner-plate, .art-panel .modal-box {
  border-style: solid; border-color: transparent; border-radius: 0; background: none;
  border-image-source: var(--imgPanel); border-image-slice: var(--slPanel) fill; border-image-width: 26px; border-image-repeat: stretch; }
.art-panel #panel { border-width: 12px; padding: 8px 8px 6px; }
.art-panel .banner-plate, .art-panel .modal-box { border-width: 14px; }
#panel::before { content: ""; position: absolute; inset: 4px; pointer-events: none; opacity: 0.12;
  background-image: radial-gradient(var(--mag) 1.2px, transparent 1.6px); background-size: 9px 9px; border-radius: 12px; }
#tabs { display: flex; gap: 5px; padding: 0 0 7px; position: relative; z-index: 1; }
.tab { flex: 1 1 0; min-width: 0; min-height: 44px; border: 3px solid var(--navy); border-radius: 14px; background: #fff; color: var(--navy); font: 900 14px var(--font); line-height: 1.1; overflow-wrap: anywhere;
  box-shadow: 0 3px 0 var(--navy); cursor: pointer; position: relative; transition: transform 0.12s; padding: 0 4px; }
.tab.on { background: var(--mag); color: #fff; text-shadow: 0 2px 0 var(--navy); transform: translateY(1px); }
.tab .dot { position: absolute; top: -6px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--yel); border: 2px solid var(--navy); animation: pulse 1s infinite; }
/* the cards scroll inside the frame; room below the last card so the fade never covers a button */
#content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; -webkit-overflow-scrolling: touch; position: relative; z-index: 1;
  padding: 2px 2px 4px; scrollbar-width: none; }
#content::-webkit-scrollbar { display: none; }
#content.more { padding-bottom: 22px; -webkit-mask-image: linear-gradient(#000 calc(100% - 12px), transparent); mask-image: linear-gradient(#000 calc(100% - 12px), transparent); }
#moreHint { position: absolute; left: 50%; bottom: -16px; z-index: 3; width: 44px; height: 26px; margin-left: -22px; padding: 0; cursor: pointer;
  background: var(--mag); border: 2.5px solid var(--navy); border-radius: 13px; box-shadow: 0 2px 0 var(--navy); animation: arrowBob 0.9s ease-in-out infinite; }
#moreHint::after { content: ""; position: absolute; left: 50%; top: 7px; margin-left: -7px; border: 7px solid transparent; border-top: 9px solid #fff; border-bottom: 0; }
#guide { max-width: 560px; }

/* white sticker cards with a thick navy outline and a halftone */
.card { position: relative; margin: 0 0 6px; background: #fff; border: 2.5px solid var(--navy); border-radius: 14px; box-shadow: 0 3px 0 var(--navy);
  background-image: radial-gradient(rgba(34, 207, 238, 0.14) 1.1px, transparent 1.5px); background-size: 8px 8px; padding: 5px 9px 2px; animation: pop 0.25s cubic-bezier(.2, 1.5, .4, 1) both; }
.card-title { font-size: 13px; font-weight: 900; color: var(--mag); margin: 0 0 1px; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; }
.card-title small { color: var(--navy2); font-size: 12px; font-weight: 700; text-align: right; }
.card-title small.money { color: #138a3e; font-size: 16px; font-weight: 900; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 2px 0; }
.row + .row, .bar + .row { border-top: 2px dashed rgba(29, 35, 80, 0.15); }
.row.duo { gap: 6px; }
.duo-half { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; }
.duo-half + .duo-half { border-left: 2px dashed rgba(29, 35, 80, 0.15); padding-left: 8px; }
.row-info { flex: 1; min-width: 0; }
.row-name { font-size: 14px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.row-sub { font-size: 12px; font-weight: 700; color: var(--navy2); margin-top: 1px; line-height: 1.2; overflow-wrap: anywhere; }
.row-val { font-size: 17px; font-weight: 900; white-space: nowrap; }
.row-ico { width: 34px; height: 34px; object-fit: contain; flex: none; }
.btns { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: 64%; }
.bar { height: 12px; border-radius: 8px; border: 2.5px solid var(--navy); background: #fff; overflow: hidden; margin: 3px 0 1px; }
.bar > i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--mag) 0 8px, #ff6dbd 8px 16px); transition: width 0.3s; }
.bar.cyan > i { background: repeating-linear-gradient(45deg, var(--cyan) 0 8px, #7be6f7 8px 16px); }
.hint { font-size: 12px; font-weight: 700; color: var(--navy2); margin: 0 0 2px; line-height: 1.3; }
.tiles { display: flex; gap: 6px; padding: 2px 0 6px; }
.tile { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.tile-ico { width: 40px; height: 40px; object-fit: contain; }
.tile-name { font-size: 12px; font-weight: 800; line-height: 1.15; min-height: 28px; display: flex; align-items: center; overflow-wrap: anywhere; }

/* capsule buttons: a yellow pill; with the art, ui-button's end caps stay round (fixed width) and only
   the middle stretches, so a taller or wider button never splits or gets cut */
.btn { min-width: 52px; min-height: 44px; max-width: 100%; padding: 0 12px; border: 2.5px solid var(--navy); border-radius: 22px; background: var(--yel); box-shadow: 0 3px 0 var(--navy);
  color: var(--navy); font: 900 14px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none;
  text-shadow: 0 1px 0 #fff8; transition: transform 0.12s cubic-bezier(.3, 1.6, .5, 1), filter 0.12s; line-height: 1.05; }
.art-btn .btn { border-style: solid; border-color: transparent; border-width: 2px 6px; border-radius: 0; background: none; box-shadow: none; padding: 1px 10px 3px;
  border-image-source: var(--imgBtn); border-image-slice: var(--slBtnV) var(--slBtnH) fill; border-image-width: 22px; border-image-repeat: stretch; }
.btn .lbl { white-space: normal; text-align: center; overflow-wrap: anywhere; }
.btn .cost { font-size: 11px; font-weight: 800; color: #6a3a00; display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.btn .cost img { width: 13px; height: 13px; }
.btn.col { flex-direction: column; gap: 0; min-height: 48px; }
.btn:active { transform: scale(0.92); }
.btn.dis { filter: grayscale(1) brightness(1.05) opacity(0.62); cursor: default; }
.btn.dis .cost { color: #444; }
.btn.sq { width: 50px; min-width: 50px; padding: 0; font-size: 20px; }
.btn.small { font-size: 12px; padding-left: 8px; padding-right: 8px; }
.btn.focus, .tab.focus { filter: drop-shadow(0 0 5px var(--cyan)) drop-shadow(0 0 2px #fff) brightness(1.08); transform: scale(1.06); }
.btn.big { min-height: 54px; font-size: 17px; padding: 0 22px; }
.btn.go { animation: wiggle 1.6s ease-in-out infinite; }
.btn.alert { animation: alertBlink 0.7s ease-in-out infinite; }
@keyframes alertBlink { 50% { filter: drop-shadow(0 0 6px #ff3ea5) drop-shadow(0 0 3px #fff) brightness(1.15); transform: scale(1.07); } }
.row.warn .row-name { color: #e8204f; }
.price-val { min-width: 58px; text-align: center; }
.btn.sell { min-width: 100px; }
.toggle.on { filter: hue-rotate(150deg) saturate(1.2); }
.empty { text-align: center; font-size: 14px; font-weight: 700; padding: 14px 6px; color: var(--navy2); }
@media (max-height: 720px) {
  .hud-num { font-size: 24px; } .hud-cap { width: 32px; height: 32px; } .log .old { display: none; }
  .guide-face { width: 40px; height: 40px; } .guide-text { font-size: 13px; } .chip { font-size: 14px; }
}
