:root {
  color-scheme: dark;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  color: #e5e7e4;
  background: #0b1014;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #e7ba78; outline-offset: 3px; }
.screen-reader-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.masthead {
  min-height: 318px;
  display: flex;
  flex-direction: column;
  background: #101820 url("/assets/rosh-ruins-background.png") center 43% / cover no-repeat;
  border-bottom: 1px solid #66523a;
}
.topbar {
  min-height: 58px;
  padding: 0 max(24px, calc((100% - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(7, 12, 16, .82);
  border-bottom: 1px solid rgba(237, 199, 138, .18);
}
.wordmark { color: #e8c696; font-family: Georgia, serif; font-size: 17px; white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: 26px; }
.nav-actions a, .nav-actions button { color: #d8dbd8; font-size: 13px; }
.nav-actions button { border: 0; padding: 0; background: transparent; }
.nav-actions a:hover, .nav-actions button:hover { color: #f5c987; }
.brand { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 22px 17px; }
.brand img { display: block; width: min(490px, 82vw); height: auto; max-height: 235px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,.48)); }
.launcher-download { display: inline-flex; align-items: center; justify-content: center; min-width: 238px; min-height: 45px; padding: 0 23px; border: 1px solid #edc991; border-radius: 4px; background: #cba16d; box-shadow: 0 5px 18px rgba(0,0,0,.35); color: #15191a; font-size: 14px; font-weight: 700; }
.launcher-download:hover { background: #e0b984; }
.server-strip {
  display: flex; align-items: center; gap: 0;
  min-height: 61px; padding: 0 max(24px, calc((100% - 1160px) / 2));
  background: rgba(7, 12, 16, .91);
  border-top: 1px solid rgba(237, 199, 138, .18);
}
.server-strip > div { display: flex; align-items: center; gap: 10px; min-width: 180px; padding: 0 24px; border-left: 1px solid #344047; }
.server-strip > div:first-child { min-width: 260px; padding-left: 0; border: 0; }
.server-strip strong { font-size: 14px; font-weight: 600; color: #f4f0e8; }
.server-state { color: #e1e7de; font-weight: 600; }
.strip-label { font-size: 12px; color: #9ca9ad; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b6905b; box-shadow: 0 0 0 3px rgba(182, 144, 91, .16); }
.status-dot.online { background: #75c99b; box-shadow: 0 0 0 3px rgba(117, 201, 155, .16); }
.status-dot.offline { background: #e17972; box-shadow: 0 0 0 3px rgba(225, 121, 114, .16); }

.main-layout {
  max-width: 1160px;
  margin: 0 auto;
  padding: 35px 24px 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 34px;
  align-items: start;
}
.shop { min-width: 0; grid-column: 1; grid-row: 1; }
.account-panel { grid-column: 2; grid-row: 1 / span 2; }
.orders { grid-column: 1; grid-row: 2; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: #c29662; font-size: 11px; font-weight: 700; }
h2 { font-family: Georgia, serif; font-size: 28px; line-height: 1.18; font-weight: 400; margin: 0; }
.currency { display: flex; flex-direction: column; align-items: end; gap: 3px; color: #a9b3b4; font-size: 12px; }
.currency strong { color: #f4cc8e; font-size: 17px; }
.shop-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 15px; }
.shop-search, .class-filter { display: grid; gap: 7px; min-width: 0; color: #b7c0c1; font-size: 12px; }
.shop-search { flex: 1 1 250px; max-width: 320px; }
.class-filter { flex: 1 1 180px; max-width: 220px; }
.shop-search input, .class-filter select { width: 100%; height: 41px; padding: 0 11px; border: 1px solid #455257; border-radius: 4px; outline: none; background: #10181c; color: #f1f3ef; font-size: 13px; }
.shop-search input:focus, .class-filter select:focus { border-color: #bc9360; }
.shop-search input::placeholder { color: #829195; }
.category-tabs, .auth-tabs { display: flex; border-bottom: 1px solid #344147; gap: 20px; overflow-x: auto; }
.category-tabs { margin-bottom: 18px; }
.category-tabs button, .auth-tabs button { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #9eaaad; min-height: 42px; padding: 0 2px; font-size: 13px; }
.category-tabs button.selected, .auth-tabs button.selected { border-color: #d6a46d; color: #f2d0a3; }
.category-tabs button:hover, .auth-tabs button:hover { color: #f2d0a3; }
.inline-message { margin: 18px 0; color: #a9b3b4; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.more-products { display: block; min-height: 42px; margin: 20px auto 0; padding: 0 20px; border: 1px solid #58696b; border-radius: 4px; background: #1a2b2e; color: #e6d1b1; font-size: 13px; }
.more-products:hover { background: #284044; }
.more-products[hidden] { display: none; }
.product {
  display: grid; grid-template-rows: auto 1fr auto;
  min-width: 0; min-height: 226px; padding: 18px;
  background: #151d21; border: 1px solid #344148; border-radius: 6px;
}
.product-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.item-symbol { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border: 1px solid #856947; border-radius: 4px; color: #e2be83; background: #2a2926; font-family: Georgia, serif; font-size: 25px; }
.item-symbol.has-icon { border-color: #526368; background: #10181b; }
.item-sprite { display: block; width: 32px; height: 32px; background-repeat: no-repeat; }
.product[data-category="craft"] .item-symbol { color: #a8d3cb; border-color: #547b76; background: #1b3031; }
.product[data-category="bags"] .item-symbol { color: #d9bd95; border-color: #7b6650; background: #302821; }
.item-code { color: #819096; font-size: 11px; }
.product h3 { margin: 0 0 7px; color: #f2ece0; font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.product p { margin: 0 0 17px; color: #a5b0ae; font-size: 12px; line-height: 1.45; }
.product-bottom { display: grid; gap: 13px; border-top: 1px solid #303b40; padding-top: 13px; }
.product-purchase { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.quantity-field { display: grid; gap: 6px; }
.quantity-field label { color: #a8b4b3; font-size: 11px; }
.quantity-stepper { display: flex; height: 34px; border: 1px solid #53666a; border-radius: 4px; overflow: hidden; background: #0d1518; }
.quantity-stepper button { width: 30px; min-width: 30px; border: 0; background: #243237; color: #f1d4a8; font-size: 17px; line-height: 1; }
.quantity-stepper button:hover { background: #354b4e; }
.quantity-stepper input { width: 49px; min-width: 0; padding: 0 2px; border: 0; border-left: 1px solid #45565b; border-right: 1px solid #45565b; border-radius: 0; outline: 0; background: #0d1518; color: #f2f0e8; text-align: center; appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.quantity-stepper:focus-within { border-color: #d5a46d; }
.product-price { display: flex; flex-direction: column; align-items: end; gap: 3px; font-size: 11px; color: #94a2a3; white-space: nowrap; }
.product-price strong { color: #f3c989; font-size: 17px; font-weight: 600; }
.buy-button, .primary-button { min-height: 41px; border: 1px solid #66989a; border-radius: 4px; background: #245c61; color: #f2f5ed; font-size: 13px; font-weight: 700; }
.buy-button { width: 100%; padding: 0 13px; }
.buy-button:hover, .primary-button:hover { background: #31737a; }

.account-panel { background: #151b1f; border: 1px solid #68543d; border-radius: 6px; padding: 22px; }
.panel-header { border-bottom: 1px solid #3d4545; padding-bottom: 18px; margin-bottom: 14px; }
.panel-header h2 { font-size: 25px; }
.auth-tabs { gap: 18px; margin-bottom: 19px; }
.account-panel form { display: flex; flex-direction: column; }
.account-panel label { display: block; margin: 0 0 7px; color: #b7c0c1; font-size: 12px; }
.account-panel input, .account-panel select { display: block; width: 100%; height: 42px; margin: 0 0 17px; padding: 0 11px; color: #f1f3ef; background: #0d1316; border: 1px solid #455257; border-radius: 4px; outline: none; }
.account-panel input:focus, .account-panel select:focus { border-color: #bc9360; }
.account-panel .primary-button { margin-top: 2px; width: 100%; }
.form-message { min-height: 23px; margin: 14px 0 0; font-size: 12px; line-height: 1.4; color: #dfc08e; }
.form-message.error { color: #eea49c; }
.profile-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.profile-top strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.field-label { display: block; margin-bottom: 5px; color: #9ba7a9; font-size: 11px; }
.text-button { border: 0; background: transparent; color: #e0b57d; text-decoration: underline; font-size: 12px; padding: 3px; }
.wallet { display: flex; align-items: center; justify-content: space-between; margin: 24px 0; padding: 14px 0; border-top: 1px solid #3a4446; border-bottom: 1px solid #3a4446; font-size: 13px; color: #bdc6c4; }
.wallet strong { font-size: 20px; color: #f2cb91; }
.quiet-note { color: #94a2a3; font-size: 12px; line-height: 1.4; margin: 0; }
.order-list { display: grid; gap: 1px; border: 1px solid #334044; }
.order-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; padding: 12px 15px; background: #151d21; font-size: 13px; }
.order-row + .order-row { border-top: 1px solid #334044; }
.order-row strong { color: #e9e9e1; font-weight: 600; }
.order-row span { color: #97a7a8; }
.order-state { color: #8dd2aa !important; text-align: right; }
.order-state.pending { color: #e8bc7f !important; }
.empty-orders { padding: 18px; color: #9ba8aa; background: #151d21; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px max(24px, calc((100% - 1160px) / 2)); background: #101619; border-top: 1px solid #344045; color: #859397; font-size: 11px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(380px, calc(100vw - 40px)); padding: 13px 17px; background: #234b49; color: #f0f4ee; border: 1px solid #70a58d; border-radius: 5px; box-shadow: 0 10px 28px rgba(0,0,0,.35); z-index: 10; }
.toast.error { background: #492d2d; border-color: #b57169; }

@media (max-width: 850px) {
  .main-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .account-panel { grid-column: 1; grid-row: 1; }
  .shop { grid-column: 1; grid-row: 2; }
  .orders { grid-column: 1; grid-row: 3; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .masthead { min-height: 237px; }
  .topbar { padding: 0 16px; min-height: 51px; gap: 8px; }
  .wordmark { font-size: 13px; }
  .nav-actions { gap: 12px; }
  .nav-actions a, .nav-actions button { font-size: 12px; }
  .brand img { max-height: 135px; }
  .launcher-download { min-width: min(238px, 100%); min-height: 42px; }
  .server-strip { min-height: 55px; padding: 0 14px; justify-content: space-between; }
  .server-strip > div { min-width: 0; padding: 0 9px; gap: 5px; font-size: 11px; }
  .server-strip > div:first-child { min-width: 0; padding-left: 0; }
  .strip-label { display: none; }
  .server-strip strong { font-size: 11px; }
  .main-layout { padding: 24px 16px 48px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product { min-height: 205px; }
  .category-tabs { gap: 15px; }
  .shop-search, .class-filter { flex-basis: 100%; max-width: none; }
  footer { padding: 18px 16px; }
}
