.store { padding-block: 32px 48px; }
.store-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 20px; }
.store h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.store-account-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; }
.store-account-links[hidden] { display: none; }
.store-account-links button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.store-account-links a { color: inherit; text-decoration: none; }
.store-account-links a:hover, .store-account-links button:hover { text-decoration: underline; }
.store-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.store-switch button, .store-actions button { padding: 12px 16px; font: inherit; cursor: pointer; }
.store-switch button { color: inherit; background: #221d26; border: 0; border-bottom: 3px solid transparent; }
.store-switch button[aria-pressed="true"] { background: #30261f; border-bottom-color: var(--gold); color: var(--gold); }
.store-switch button:hover { color: var(--gold); }
.store-notice { color: var(--muted); font-size: .9rem; }
.store-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.store-product { min-width: 0; padding: 12px; background: #353538; }
.store-product img { justify-self: center; object-fit: contain; }
.store-product h3, .store-product p { margin: 0; }
.store-product p { color: var(--muted); }
.store-product button { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
#store-selection, #store-login, #store-orders { width: min(440px, calc(100% - 30px)); padding: 24px; color: inherit; background: #201c16; border: 1px solid var(--line); }
#store-selection::backdrop, #store-login::backdrop, #store-orders::backdrop { background: #100c15bb; }
#store-recipient label, #store-login-form label { display: grid; gap: 6px; margin-block: 12px; }
#store-recipient input, #store-login-form input { width: 100%; padding: 8px 10px; color: inherit; background: #151410; border: 1px solid var(--line); font: inherit; }
.store-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.top-up-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.top-up-art {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px 12px;
  border: 4px double #b88130;
  background: radial-gradient(ellipse at 50% 15%, #ffe8ae, #d79b44 85%);
  color: #432812;
  text-align: center;
}
.top-up-art img { display: block; object-fit: contain; width: min(100%, 156px); height: 88px; }
.top-up-art h3 { margin: 0; font-size: clamp(.95rem, 1.5vw, 1.2rem); }
.top-up-controls, .store-cart-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: #2d2828;
}
.top-up-controls strong, .store-cart-actions p { color: var(--gold); }
.top-up-quantity { display: flex; align-items: center; gap: 6px; }
.top-up-count { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.top-up-quantity button {
  width: 30px; height: 30px; border: 0; border-radius: 3px;
  color: #261809; background: #e8ad51; font: inherit; cursor: pointer;
}
.store-cart-actions { justify-content: flex-end; margin-top: 18px; }
.store-cart-actions button { border: 0; cursor: pointer; }
.top-up-quantity button:disabled, .store-cart-actions button:disabled { opacity: .5; cursor: default; }
@media (max-width: 820px) { .top-up-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .top-up-grid { gap: 8px; } }

#store-login-form { position: relative; }
#store-login-title { padding-right: 32px; }
.store-login-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  font: 28px/1 sans-serif;
  cursor: pointer;
}
.store-login-close-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.store-login-submit { display: flex; justify-content: center; }
.store-login-submit .button { width: min(100%, 232px); }
.store-social-login {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.store-provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #202124;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  font-family: inherit;
  cursor: pointer;
}
.store-google-button:hover { background: #f1f3f4; }
.store-apple-button { background: #000; color: #fff; border-color: #6e6e6e; }
.store-apple-button img { filter: brightness(0) invert(1); }
.store-provider-button:disabled { opacity: .72; cursor: default; }
.store-provider-note { margin: 8px 0 0; text-align: center; font-size: .8rem; }
#store-google-hint { margin: 10px 0 0; text-align: center; font-size: .875rem; }
.store-login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 0; }

.store-cart { margin-top: 24px; padding: 20px; background: #242027; border: 1px solid var(--line); }
.store-cart h2 { font-size: 1.5rem; margin-top: 0; }
.cart-scroll { overflow-x: auto; }
.cart-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.cart-table th, .cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.cart-table td:first-child { display: flex; align-items: center; gap: 12px; }
.cart-table img { object-fit: contain; }
.cart-table button { color: inherit; background: #463b3e; border: 0; padding: 5px 9px; cursor: pointer; }
.cart-table button:disabled { opacity: .5; }
.cart-quantity { white-space: nowrap; }
.cart-total { text-align: right; color: var(--gold); font-weight: 700; }

#item-shop > .store-product { display: flex; flex-direction: column; align-items: stretch; border: 0; }
.store-item-art { position: relative; display: grid; justify-items: center; align-items: center; align-content: center; min-height: 160px; padding: 12px 4px 20px; gap: 10px; text-align: center; }
.store-item-art h3 { margin: 0; font-family: inherit; font-size: 1rem; line-height: 1.3; font-weight: 700; }
.store-item-art img { width: 80px; height: 80px; }
.store-item-tooltip { display: none; position: absolute; bottom: calc(100% - 16px); left: 50%; transform: translateX(-50%); width: min(260px, 85vw); padding: 10px; border-radius: 3px; background: #111; color: #fff; text-align: left; font-size: .875rem; line-height: 1.45; z-index: 2; }
.store-item-art:hover .store-item-tooltip, .store-item-art:focus .store-item-tooltip { display: block; }
.store-item-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid #242426; padding-top: 12px; }
.store-item-controls > span { color: var(--gold); font-size: .875rem; }
.store-item-count { min-width: 2ch; text-align: center; }

#item-shop { gap: 20px; }
#item-shop .store-item-art { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; }
#item-shop .store-item-controls { width: 100%; box-sizing: border-box; margin-top: auto; }
#item-shop .store-item-art img { justify-self: center; margin-inline: auto; }
#item-shop .store-item-art h3 { justify-self: center; width: 100%; text-align: center; font-size: .9rem; }
#item-shop .store-item-controls { flex-wrap: nowrap; gap: 4px; }
#item-shop .top-up-quantity { gap: 4px; }
#item-shop .top-up-quantity button { width: 24px; height: 24px; }
@media (max-width: 900px) { #item-shop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { #item-shop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 390px) { #item-shop { grid-template-columns: 1fr; } }

#store-orders { width: min(1100px, 94vw); max-width: 94vw; }
.order-table-scroll { overflow-x: auto; margin-top: 16px; }
.order-history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-history-table th, .order-history-table td { padding: 12px 10px; border-bottom: 1px solid #514735; text-align: left; white-space: pre-line; }
.order-history-table td:first-child { overflow-wrap: anywhere; min-width: 180px; }

#store-orders-close { top: 12px; right: 12px; }
#store-orders-title { font-size: 28px; padding-right: 36px; }

/* Shanhai landscape cards. Decorative art stays behind the product and its tooltip. */
#item-shop > .store-product {
  padding: 12px;
  border: 1px solid #88779766;
  border-radius: 10px 10px 5px 5px;
  background: url("../images/store/item-card-landscape.svg?v=2") center / 100% 100% no-repeat,
    linear-gradient(155deg, #302b46f5, #1b2635f5 76%, #192a32f5);
  box-shadow: 0 7px 20px #090b172e, inset 0 1px 0 #dfc7ed12;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#item-shop > .store-product:hover, #item-shop > .store-product:focus-within {
  border-color: #cfb67eaa;
  box-shadow: 0 8px 24px #090b1755, inset 0 1px 0 #dfc7ed20;
}
#item-shop .store-item-art { min-height: 166px; padding-top: 10px; padding-bottom: 22px; }
#item-shop .store-item-art img { filter: drop-shadow(0 6px 9px #0a0b2299); }
#item-shop .store-item-art h3 { color: #f0e6d5; font-weight: 600; letter-spacing: .015em; }
#item-shop .store-item-controls { position: relative; border-top: 1px solid #a69ab138; padding-top: 12px; padding-bottom: 2px; }
#item-shop .store-item-controls::before { content: ""; position: absolute; top: -3px; left: 50%; width: 5px; height: 5px; transform: translateX(-50%) rotate(45deg); background: #bca67c; box-shadow: 0 0 6px #dfc19033; }
#item-shop .store-item-controls > span { color: #c6c0d7; }
#item-shop .top-up-quantity { gap: 5px; }
#item-shop .top-up-quantity button { width: 26px; height: 26px; border: 1px solid #91b4b080; border-radius: 5px; color: #e7f1e8; background: linear-gradient(145deg, #3b6268, #29444f); font-weight: 500; }
#item-shop .top-up-quantity button:hover:not(:disabled) { border-color: #e1c991; background: #476d71; }
#item-shop .top-up-quantity button:disabled { opacity: .38; }
#item-shop .top-up-quantity button:focus-visible { outline: 2px solid #ead09c; outline-offset: 3px; }
#item-shop .store-item-count { color: #e9e2f2; font-size: .875rem; }
#item-shop .store-item-tooltip { border: 1px solid #857898; border-radius: 6px; background: #171c2bf5; box-shadow: 0 6px 20px #090b1755; color: #ede7f3; }
.store-switch { gap: 10px; border: 0; margin-bottom: 16px; }
.store-switch button { position: relative; border: 1px solid #8f7d9b66; border-radius: 6px; background: #201e31e8; color: #cdc8dd; }
.store-switch button[aria-pressed="true"] { border-color: #b9ad8299; background: linear-gradient(110deg, #384551ed, #383044ed); color: #f0d9a7; }
.store-switch button[aria-pressed="true"]::before { content: "✦"; margin-right: 9px; color: #b8d5d7; font-size: .85em; }
@media (prefers-reduced-motion: reduce) { #item-shop > .store-product { transition: none; } }

/* Star Stone packs share the item shop's landscape theme. */
.top-up-card {
  min-width: 0;
  border: 1px solid #88779766;
  border-radius: 10px 10px 5px 5px;
  background: url("../images/store/item-card-landscape.svg?v=2") center / 100% 100% no-repeat,
    linear-gradient(155deg, #302b46f5, #1b2635f5 76%, #192a32f5);
  box-shadow: 0 7px 20px #090b172e, inset 0 1px 0 #dfc7ed12;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.top-up-card:hover, .top-up-card:focus-within { border-color: #cfb67eaa; box-shadow: 0 8px 24px #090b1755, inset 0 1px 0 #dfc7ed20; }
.top-up-art { min-height: 166px; padding: 16px 10px 22px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: #f0e6d5; align-content: center; gap: 12px; }
.top-up-art img { filter: drop-shadow(0 6px 9px #0a0b2299); }
.top-up-art h3 { font-family: inherit; font-size: .95rem; font-weight: 600; line-height: 1.3; letter-spacing: .015em; }
.top-up-card .top-up-controls { position: relative; margin: 0 12px; padding: 12px 0 14px; border-top: 1px solid #a69ab138; background: transparent; font-size: .875rem; }
.top-up-card .top-up-controls::before { content: ""; position: absolute; top: -3px; left: 50%; width: 5px; height: 5px; transform: translateX(-50%) rotate(45deg); background: #bca67c; box-shadow: 0 0 6px #dfc19033; }
.top-up-card .top-up-controls > span { color: #c6c0d7; }
.top-up-card .top-up-controls strong { color: #ebd8b0; font-weight: 600; }
.top-up-card .top-up-quantity { gap: 5px; }
.top-up-card .top-up-quantity button { width: 26px; height: 26px; border: 1px solid #91b4b080; border-radius: 5px; color: #e7f1e8; background: linear-gradient(145deg, #3b6268, #29444f); font-weight: 500; }
.top-up-card .top-up-quantity button:hover:not(:disabled) { border-color: #e1c991; background: #476d71; }
.top-up-card .top-up-quantity button:disabled { opacity: .38; }
.top-up-card .top-up-quantity button:focus-visible { outline: 2px solid #ead09c; outline-offset: 3px; }
.top-up-card .top-up-count { color: #e9e2f2; }
.store-cart-actions { border: 1px solid #88779755; border-radius: 6px; background: #232a3be8; }
.store-cart-actions .button { border: 1px solid #91b4b080; color: #e7f1e8; background: linear-gradient(145deg, #3b6268, #29444f); }
.store-cart-actions .button:hover:not(:disabled) { border-color: #e1c991; background: #476d71; }
@media (prefers-reduced-motion: reduce) { .top-up-card { transition: none; } }

/* Warm gold for currency packs; item cards retain their blue-violet theme. */
.top-up-card {
  border-color: #b58d50;
  background: url("../images/store/top-up-clouds.svg?v=2") center / 100% 100% no-repeat,
    radial-gradient(ellipse at 45% 8%, #ecd59e 0%, #d3b375 54%, #b99055 100%);
  box-shadow: 0 7px 20px #090b1738, inset 0 0 0 1px #fff0c340;
}
.top-up-card:hover, .top-up-card:focus-within { border-color: #e1c58c; box-shadow: 0 8px 24px #090b1755, inset 0 0 0 1px #fff4d16b; }
.top-up-art { color: #34271b; }
.top-up-art img { filter: drop-shadow(0 5px 7px #73502b55); }
.top-up-card .top-up-controls { border-top-color: #79532950; }
.top-up-card .top-up-controls::before { background: #8a6339; box-shadow: 0 0 0 3px #d2b075; }
.top-up-card .top-up-controls > span { color: #453223; }
.top-up-card .top-up-controls strong { color: #2e2118; font-weight: 700; }
.top-up-card .top-up-count { color: #34271b; font-weight: 600; }
.top-up-card .top-up-quantity button { border-color: #725236; color: #fff4d7; background: linear-gradient(145deg, #795a3a, #604329); }
.top-up-card .top-up-quantity button:hover:not(:disabled) { border-color: #67421d; background: #644723; }
.top-up-card .top-up-quantity button:focus-visible { outline-color: #4d3722; }

.top-up-art h3 { text-shadow: 0 1px 0 #fff1cc55; }

.top-up-art .star-stone-amount { font-size: 1.2em; font-weight: 750; font-variant-numeric: tabular-nums; }

.checkout-page { max-width: 900px; padding-block: 32px 48px; }
.checkout-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.checkout-page .panel { max-width: none; }
.checkout-page select { min-height: 42px; width: 100%; padding: 8px; color: inherit; background: #211e29; border: 1px solid var(--line); font: inherit; }

/* Compact order confirmation, with recipient controls on one row. */
.checkout-page { max-width: 1120px; padding-block: 22px 36px; }
.checkout-page h1 { font-size: clamp(1.7rem, 3vw, 2.25rem); margin: 0 0 10px; }
.checkout-page > p { margin: 0 0 18px; font-size: .875rem; color: #c9c1b5; }
.checkout-page .panel { padding: 18px 22px; margin-block: 0; }
.checkout-summary { border-bottom: 0; }
.checkout-table-scroll { overflow-x: auto; }
.checkout-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9375rem; }
.checkout-table th { padding: 8px 12px 12px; color: #c9c1b5; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.checkout-table td { padding: 10px 12px; border-bottom: 1px solid #bba07526; font-variant-numeric: tabular-nums; }
.checkout-table td:first-child { display: flex; align-items: center; gap: 14px; min-width: 220px; }
.checkout-table td img { width: 80px; height: 46px; object-fit: contain; flex-shrink: 0; }
.checkout-table th:not(:first-child), .checkout-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.checkout-table td:last-child { color: #edcf91; }
#checkout-total { margin: 14px 12px 0; text-align: right; color: #edcf91; font-weight: 600; }
.checkout-page .signup-form fieldset { gap: 12px; }
.checkout-recipient-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.checkout-page .checkout-recipient-row label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; font-size: .9375rem; }
.checkout-page select { min-height: 36px; padding: 6px 8px; }
.checkout-delivery-note { color: #bdb5a8; font-size: .8125rem; line-height: 1.5; }
.checkout-delivery-note p { margin: 0 0 4px; }
#checkout-status { margin: 0; font-size: .875rem; }
#checkout-status:empty { display: none; }
.checkout-actions { display: flex; flex-direction: row-reverse; align-items: center; gap: 20px; margin-top: 2px; }
.checkout-page .checkout-actions button { min-height: 38px; }
.checkout-actions a { font-size: .875rem; }
@media (max-width: 680px) {
  .checkout-page .panel { padding: 14px 12px; }
  .checkout-recipient-row { grid-template-columns: 1fr; gap: 10px; }
  .checkout-page .checkout-recipient-row label { grid-template-columns: 1fr; gap: 5px; }
  .checkout-table td:first-child { min-width: 180px; gap: 6px; }
  .checkout-table td img { width: 54px; height: 38px; }
  .checkout-table th, .checkout-table td { padding-inline: 7px; }
}

.checkout-recipient-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
.checkout-buyer { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; font-size: .9375rem; }
.checkout-buyer > span { flex-shrink: 0; }
.checkout-buyer output { display: block; min-width: 0; overflow-wrap: anywhere; color: #edcf91; }
@media (max-width: 680px) { .checkout-recipient-row { grid-template-columns: 1fr; } }

.cart-payment-actions { text-align: right; }
.cart-payment-actions p { margin-block: 12px; }

/* Persistent cart tab with a combined currency/item quantity badge. */
.store-cart-actions { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); margin: 0; padding: 0; border: 0; background: none; z-index: 40; }
.store-cart-actions .floating-cart { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; width: 54px; padding: 0; border: 1px solid #acbdb2; border-radius: 5px; color: #fff4d9; background: linear-gradient(135deg, #446b70, #29434e); box-shadow: 0 4px 18px #080c2466; cursor: pointer; }
.floating-cart-icon { display: grid; place-items: center; width: 100%; padding: 9px 7px; border-bottom: 1px solid #cbb78488; }
.floating-cart-icon svg { width: 32px; height: 32px; }
.floating-cart-label { writing-mode: vertical-rl; padding: 13px 10px; font-size: 1rem; font-weight: 600; letter-spacing: .045em; }
.floating-cart-badge { position: absolute; top: -12px; left: -12px; display: grid; place-items: center; min-width: 27px; height: 27px; padding-inline: 5px; border: 2px solid #f5dad1; border-radius: 99px; color: #fff; background: #cf252e; font: 700 13px/1 Arial, sans-serif; box-shadow: 0 2px 5px #13071055; }
.floating-cart-badge[hidden] { display: none; }
.floating-cart-chevron { width: 10px; height: 10px; margin: 0 0 15px; border-right: 2px solid #e6cf98; border-bottom: 2px solid #e6cf98; transform: rotate(45deg); }
.store-cart-actions .floating-cart:focus-visible { outline: 2px solid #f1d395; outline-offset: 4px; }
.store-cart { scroll-margin-top: 85px; }
@media (min-width: 681px) { .store { padding-right: 70px; } }
@media (max-width: 680px) {
  .store-cart-actions { right: 12px; top: auto; bottom: 20px; transform: none; }
  .store-cart-actions .floating-cart { width: auto; flex-direction: row; border-radius: 6px; }
  .floating-cart-icon { width: auto; padding: 8px; border-bottom: 0; }
  .floating-cart-icon svg { width: 25px; height: 25px; }
  .floating-cart-label { writing-mode: horizontal-tb; padding: 10px 12px 10px 0; font-size: .875rem; }
  .floating-cart-chevron { display: none; }
}

/* Distinguish cart amounts and quantities from descriptive text. */
.floating-cart-label { font-size: 1.15rem; }
.floating-cart-icon svg { width: 36px; height: 36px; }
.cart-table td:nth-child(3), .cart-table td:nth-child(5) { color: #edc579; font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-table .cart-price-pending td:nth-child(3), .cart-table .cart-price-pending td:nth-child(5) { color: #b7ad9d; font-weight: 400; }
.cart-line-count { display: inline-block; min-width: 26px; padding-inline: 5px; text-align: center; color: #9fd9de; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) {
  .floating-cart-label { font-size: 1rem; }
  .floating-cart-icon svg { width: 28px; height: 28px; }
}

.store-cart .cart-total { font-size: 1.125rem; }
