/* The shop is a compact game HUD, leaving the tactical map as the main surface. */
.topbar { height: 60px; flex-basis: 60px; }
.map-heading { top: 22px; }
.eyebrow { font-size: 9px; margin-bottom: 6px; }
h1 { font-size: 21px; }
.map-meta { margin-top: 7px; }
.view-controls { top: 24px; }
.map-viewport { inset: 70px 20px 38px; }
.selection-readout { bottom: 12px; }
.map-note { bottom: 18px; }
.map-note.legend { gap: 23px; }
.map-note .legend-item { font-size: 10px; color: #aeb7b3; }
.shop {
  --gold: #e3bf72;
  position: relative; flex: 0 0 auto; z-index: 5;
  background: linear-gradient(180deg, #252d2e 0%, #1c2325 100%);
  border-top: 1px solid #8d7b4c;
  box-shadow: 0 -8px 30px #13191950, inset 0 1px #e5cf9230;
  padding: 0 36px;
}
.shop::before { content: ''; position: absolute; width: 64px; height: 3px; top: -2px; left: calc(50% - 32px); background: #ccb374; box-shadow: 0 0 16px #e6cd7855; }
.shop-inner { max-width: 1440px; margin: 0 auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.shop-toolbar { height: 47px; display: flex; align-items: center; justify-content: space-between; position: relative; }
.shop-toolbar h2 { font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; color: #c4c8bb; font-weight: 550; margin: 0; display: flex; align-items: center; gap: 9px; }
.shop-heading-mark { font-size: 23px; color: #c3ab70; line-height: 1; }
.wallet { display: flex; align-items: center; gap: 8px; color: var(--gold); position: absolute; left: 50%; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.wallet svg { width: 25px; height: 25px; filter: drop-shadow(0 0 8px #f5cb4433); }
#kamas-count { font-size: 23px; font-weight: 650; min-width: 27px; }
.wallet-label { font-size: 9px; letter-spacing: 1.8px; color: #a59a7d; padding: 3px 0 0 2px; }
.preview-tools { display: flex; align-items: center; gap: 16px; }
.preview-badge { color: #939f99; font-size: 10px; }
#reset-shop { background: none; color: #a5b0aa; font-size: 10px; border: 0; padding: 8px 0 8px 14px; border-left: 1px solid #ffffff19; }
#reset-shop:hover { color: #f2dfb0; }
.shop-content { display: grid; grid-template-columns: 178px minmax(0, 1fr); gap: 22px; }
.shop-actions { display: grid; grid-template-rows: 39px 49px 49px; gap: 7px; }
.level-panel { padding: 0 2px; }
.level-info { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: #c3cddd; }
.level-info strong { font-size: 18px; color: #e2e7eb; font-weight: 650; margin-left: 3px; }
.xp-label { font-size: 10px; color: #9cabb7; font-variant-numeric: tabular-nums; }
.xp-track { height: 4px; margin-top: 7px; background: #11191c; border-radius: 1px; box-shadow: 0 1px #ffffff0d; overflow: hidden; }
#xp-fill { width: 33.333%; height: 100%; background: linear-gradient(90deg, #6a93b5, #a1d0ed); box-shadow: 0 0 8px #a1d0ed40; transition: width .25s ease; }
.shop-action { display: flex; align-items: center; width: 100%; gap: 10px; padding: 0 13px; border: 1px solid #6c746b; border-radius: 3px; color: #e5e9dd; background: linear-gradient(#3e4845, #303b37); box-shadow: inset 0 1px #ffffff0a, 0 2px 3px #0002; transition: border-color .15s, background .15s, transform .15s; }
.shop-action .action-icon { width: 22px; height: 22px; color: #adb9a4; flex-shrink: 0; }
.action-label { font-size: 13px; font-weight: 550; text-align: left; }
.action-label small { display: block; font-size: 9px; color: #b7c9d5; font-weight: 400; margin-top: 2px; }
.action-cost { display: flex; gap: 5px; align-items: center; margin-left: auto; color: var(--gold); font-size: 13px; }
.action-cost svg { width: 16px; height: 16px; }
.xp-action { background: linear-gradient(#34444f, #2a3843); border-color: #596c78; }
.xp-action .action-icon { color: #b1cfe2; }
.shop-action:hover:not(:disabled) { background: #47574f; border-color: #d5c591; transform: translateY(-1px); }
.xp-action:hover:not(:disabled) { background: #425b6d; border-color: #afd3e6; }
.shop-action:active:not(:disabled) { transform: translateY(1px); }
.shop-action:disabled { opacity: .4; cursor: default; }
.shop-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.shop-card { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; min-width: 0; height: 151px; border: 1px solid #87918b; border-radius: 3px; background: #1a2423; color: #f3f2e9; text-align: left; box-shadow: 0 3px 7px #0004; transition: transform .16s, box-shadow .16s, border-color .16s; }
.shop-card::before { content: ''; position: absolute; z-index: 2; left: 0; top: 0; right: 0; height: 2px; background: #b6beb2; opacity: .85; }
.card-art { position: relative; display: block; flex: 1; min-height: 0; overflow: hidden; width: 100%; background: #6b7545; }
.card-art img { position: relative; z-index: 1; display: block; height: 100%; width: 100%; object-fit: contain; transform: scale(1.08); transition: transform .3s; }
.tofu-card .card-art { background: radial-gradient(ellipse at 50% 43%, #a4b56a 0%, #6c8052 38%, #3b5143 100%); }
.bouftou-card .card-art { background: radial-gradient(ellipse at 50% 43%, #99b2ab 0%, #667f78 38%, #364b49 100%); }
.card-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #16222085, transparent 44%); box-shadow: inset 0 0 25px #101c1b30; }
.card-info { display: flex; justify-content: space-between; align-items: center; padding: 7px 11px 9px; min-height: 49px; background: linear-gradient(105deg, #32403b, #25332e); border-top: 1px solid #cad4bd39; }
.card-copy { display: flex; flex-direction: column; gap: 3px; }
.card-rarity { font-size: 7px; color: #adb9ab; letter-spacing: 1.6px; line-height: 1; }
.card-copy strong { font-size: 16px; letter-spacing: .1px; line-height: 1.1; font-weight: 600; }
.card-cost { display: flex; align-items: center; gap: 5px; color: #f4d894; font-size: 17px; font-weight: 500; }
.card-cost svg { width: 17px; height: 17px; }
.card-selected { display: none; position: absolute; top: 9px; right: 9px; width: 21px; height: 21px; border-radius: 50%; color: #202d29; background: #efdf9f; font-weight: 750; text-align: center; line-height: 21px; box-shadow: 0 2px 7px #0005; }
.shop-card:hover:not(:disabled) { transform: translateY(-4px); border-color: #e1d4a0; box-shadow: 0 7px 20px #0006; }
.shop-card:hover:not(:disabled) .card-art img { transform: scale(1.14); }
.shop-card[aria-pressed="true"] { border-color: #edd697; box-shadow: 0 0 0 1px #edd697, 0 5px 16px #0005; }
.shop-card[aria-pressed="true"] .card-selected { display: block; }
.shop-card:focus-visible { outline: 2px solid #ebd89b; outline-offset: 3px; }
.shop-bottomline { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 9px; color: #91a198; }
.pool-label { display: flex; align-items: center; gap: 7px; color: #aeb6a9; white-space: nowrap; }
.pool-label i { width: 5px; height: 5px; border-radius: 50%; background: #adb8a4; }
.pool-label > span { color: #82958b; margin-left: 6px; }
#shop-status { text-align: right; }
@media (min-width: 1600px) and (min-height: 850px) {
  .shop { padding-bottom: 6px; }
  .shop-toolbar { height: 52px; }
  .shop-card { height: 178px; }
  .shop-actions { grid-template-rows: 46px 57px 57px; gap: 9px; }
  .shop-content { grid-template-columns: 190px minmax(0, 1fr); gap: 26px; }
  .card-info { padding: 9px 13px 11px; min-height: 54px; }
  .card-copy strong { font-size: 17px; }
}
@media (max-width: 1000px) {
  .shop { padding: 0 22px; }
  .shop-content { grid-template-columns: 142px minmax(0, 1fr); gap: 13px; }
  .shop-cards { gap: 7px; }
  .card-info { padding-left: 8px; padding-right: 8px; }
  .card-copy strong { font-size: 14px; }
  .card-cost { gap: 3px; font-size: 14px; }
  .card-cost svg { width: 14px; height: 14px; }
}
@media (max-width: 850px) {
  .topbar { height: 54px; flex-basis: 54px; }
  .map-heading { top: 18px; }
  h1 { font-size: 19px; }
  .map-meta { font-size: 10px; }
  .view-controls { top: 22px; right: 22px; left: auto; }
  .view-button { padding: 8px; }
  .view-button:first-child span { display: none; }
  .map-viewport { inset: 83px 3px 46px; }
  .selection-readout { bottom: 10px; font-size: 10px; }
  .shop { padding: 0 16px; }
  .shop-toolbar { height: 43px; }
  .shop-toolbar h2 { font-size: 9px; letter-spacing: 1px; }
  .shop-content { display: flex; flex-direction: column; gap: 10px; }
  .shop-actions { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 42px; gap: 10px; }
  .level-panel { align-self: center; padding-right: 5px; }
  .shop-action { padding: 0 10px; }
  .action-label small { display: inline; margin-left: 5px; }
  .shop-card { height: 139px; }
  .card-info { min-height: 44px; padding-top: 6px; padding-bottom: 7px; }
  .shop-bottomline { min-height: 29px; }
}
@media (max-width: 520px) {
  .topbar { padding: 0 16px; }
  .map-heading { left: 16px; }
  .map-meta { font-size: 9px; }
  .map-meta span { padding: 0 3px; }
  .view-controls { right: 16px; top: 21px; gap: 5px; }
  .view-button { padding: 8px; }
  .view-button span { display: none; }
  .view-button .hash { display: inline; }
  .map-viewport { inset: 85px 0 54px; }
  .selection-readout { left: 16px; right: 16px; line-height: 1.5; }
  .shop-toolbar { height: 42px; }
  .shop-toolbar h2 { font-size: 8px; letter-spacing: .7px; gap: 5px; }
  .shop-heading-mark { font-size: 18px; }
  .wallet { gap: 5px; }
  #kamas-count { font-size: 21px; }
  .wallet svg { width: 17px; height: 17px; }
  .wallet-label, .preview-badge { display: none; }
  #reset-shop { border: 0; font-size: 10px; }
  .shop-actions { grid-template-columns: 1fr 1.16fr 1fr; gap: 7px; }
  .shop-action { padding: 0 8px; gap: 5px; }
  .shop-action .action-icon { width: 15px; height: 15px; }
  .action-label { font-size: 11px; }
  .action-label small { display: none; }
  .action-cost { gap: 3px; font-size: 11px; }
  .action-cost svg { width: 10px; height: 10px; }
  .level-info { font-size: 10px; }
  .level-info strong { font-size: 16px; margin-left: 1px; }
  .xp-label { font-size: 8px; }
  .shop-cards { display: flex; overflow-x: auto; overflow-y: hidden; padding: 4px 1px 6px; margin: -4px -16px -6px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #69746b #1c2524; }
  .shop-card { flex: 0 0 146px; height: 142px; scroll-snap-align: center; }
  .shop-card:hover { transform: none; }
  .shop-card:focus-visible { outline-offset: -3px; }
  .pool-label > span { display: none; }
  .shop-bottomline { min-height: 34px; gap: 12px; font-size: 8px; }
  #shop-status { max-width: 230px; }
}
@media (max-height: 650px) and (min-width: 851px) {
  .topbar { height: 46px; flex-basis: 46px; }
  .map-heading { top: 14px; }
  .map-meta { display: none; }
  .view-controls { top: 16px; }
  .map-viewport { inset: 48px 20px 30px; }
  .selection-readout { bottom: 6px; }
  .map-note { bottom: 12px; }
  .shop-toolbar { height: 36px; }
  .shop-card { height: 126px; }
  .shop-actions { grid-template-rows: 32px 40px 40px; gap: 7px; }
  .shop-bottomline { min-height: 24px; }
}
@media (max-height: 540px) and (max-width: 850px) {
  body { height: auto; min-height: 100dvh; overflow-y: auto; }
  main { flex: 0 0 330px; }
}
@media (prefers-reduced-motion: reduce) { .shop *, .shop *::before { transition: none !important; } }
