/* Limited Shop - follows the look of the Flame Shop / Shopping Game pages */

/* Rarity: --r is the label colour, --r-bg tints the item picture area */
.rarity-common    { --r: #6b7280; --r-bg: #f4f5f7; }
.rarity-uncommon  { --r: #3f8f2a; --r-bg: #eef7ea; }
.rarity-rare      { --r: #1f6fc4; --r-bg: #eaf2fc; }
.rarity-epic      { --r: #8a3fd1; --r-bg: #f5edfd; }
.rarity-legendary { --r: #c46a00; --r-bg: #fff3e0; }
.rarity-limited   { --r: #8b0000; --r-bg: #fdeaea; } /* same red as the Flame Shop's LIMITED EDITION */

/* Top bar: timer, balance, admin link */
.ls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0 10px;
}

.ls-timer {
  background: #f8f9fa;
  padding: 10px 16px;
  border-radius: 8px;
}

.ls-timer strong {
  font-variant-numeric: tabular-nums;
}

.ls-timer-ending strong {
  color: #d32f2f;
}

.ls-balance {
  display: flex;
  gap: 12px;
  font-weight: bold;
}

.ls-balance span,
.buybtn img,
.ls-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ls-balance img,
.buybtn img,
.ls-cost img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.ls-manage {
  display: inline-block;
  background: #555;
  color: #fff;
  padding: 7px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9em;
}

.ls-manage:hover {
  background: #333;
  color: #fff;
  text-decoration: none;
}

.ls-empty {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 30px 20px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-top: 20px;
}

/* Items */
.ls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 15px;
  margin: 12px 0 30px;
}

.ls-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.ls-item {
  display: flex;
  flex-direction: column;
  background: white;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.ls-item-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 170px;
  background: var(--r-bg, #f8f9fa);
  border-radius: 6px;
  overflow: hidden;
}

.ls-grid-featured .ls-item-art {
  height: 230px;
}

.ls-flame {
  width: 120px;
  height: 120px;
}

.ls-grid-featured .ls-flame {
  width: 170px;
  height: 170px;
}

.ls-item-name {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.ls-item-meta {
  margin: 2px 0 8px;
  color: #777;
  font-size: 0.85em;
}

.ls-rarity {
  color: var(--r);
  font-weight: bold;
}

.ls-item-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.ls-item .buybtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 70px;
  margin: 0;
  cursor: pointer;
  color: #000;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.95em;
}

.ls-item .buybtn:hover {
  filter: brightness(0.95);
}

.buybtn.ls-diamondbtn {
  background: #63e3ff;
}

/* Border shown on an avatar, same geometry as blogs (bordereffects.css .ub):
   the 175x250 border image is 1.75x the avatar's width, avatar centred in its top square.
   The box is just that square so the avatar lands in the middle; the rest hangs below. */
.ls-border {
  --ava: 77px;
  position: relative;
  display: inline-block;
  flex: none;
  width: calc(var(--ava) * 1.75);
  height: calc(var(--ava) * 1.75);
}

.ls-border-ava {
  position: absolute;
  top: calc(var(--ava) * 0.375);
  left: calc(var(--ava) * 0.375);
  width: var(--ava);
  height: var(--ava);
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #e6e6e6;
  background-repeat: no-repeat;
  background-size: 180%;
  background-position: top;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ls-border-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--ava) * 2.5);
  pointer-events: none;
}

.ls-grid-featured .ls-border {
  --ava: 103px;
}

/* Purchase modal - same look as the Flame Shop's */
.ls-modal {
  width: min(420px, calc(100% - 32px));
  padding: 25px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.ls-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.ls-modal h2 {
  margin-top: 0;
}

.ls-modal-close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.ls-modal .ls-item-art {
  height: 190px;
  margin-bottom: 10px;
  background: #f8f9fa;
}

.ls-modal .ls-flame {
  width: 140px;
  height: 140px;
}

.ls-modal .ls-border {
  --ava: 84px;
}

.ls-modal-name {
  font-weight: 600;
  font-size: 1.1em;
  margin: 5px 0 10px;
}

.ls-modal-line {
  margin: 0 0 6px;
  color: #555;
}

.ls-modal-warn {
  color: #d32f2f;
  font-weight: bold;
}

.ls-modal form {
  margin: 16px 0 0;
}

.ls-modal-btn {
  width: 100%;
  font-size: 1.05em;
  cursor: pointer;
}

.ls-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ls-modal .ls-cancel {
  margin-top: 10px;
  background: #dc3545;
  color: #fff;
}

.ls-modal .ls-grey {
  margin-top: 18px;
  background: #ddd;
}

/* Item type, top right of the picture */
.ls-type-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e0e0e0;
  color: #555;
  font-size: 11px;
  font-weight: bold;
}

.ls-owned-note {
  color: #2e7d32;
  font-weight: bold;
}

/* Buy for Me / Gift a Friend - same as the Flame Shop's choice popup */
.ls-choice {
  max-width: 380px;
  text-align: center;
}

.ls-choice h2 {
  margin-bottom: 6px;
}

.ls-choice-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}

.ls-choice-buttons button {
  width: 130px;
  height: 110px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: bold;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.15s;
}

.ls-choice-self {
  border: 2px solid #f5ea47;
  background: #fffde7;
}

.ls-choice-self:hover {
  background: #fff9c4;
}

.ls-choice-gift {
  border: 2px solid #ffb3c6;
  background: #fff0f5;
}

.ls-choice-gift:hover {
  background: #ffe0ec;
}

.ls-choice-owned {
  margin-top: 12px;
}

/* Gift form */
.ls-gift-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
}

.ls-gift-form input[type="text"],
.ls-gift-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.ls-gift-form textarea {
  height: 70px;
  resize: vertical;
}

.ls-gift-form .ls-gift-anon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  margin: 4px 0 16px;
}

/* ---------- Admin ---------- */

.ls-muted {
  color: #777;
  font-size: 0.9em;
}

.ls-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 5px 0 20px;
}

.ls-admin-tabs a {
  padding: 7px 16px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #333;
  font-weight: bold;
  text-decoration: none;
}

.ls-admin-tabs a:hover {
  background: #e6e6e6;
}

.ls-admin-tabs a.active {
  background: #f5ea47;
  color: #000;
}

button.ls-manage {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

/* Section heading with actions on the right */
.ls-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
}

.ls-section-head h3 {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
}

.ls-section-head .note {
  margin-left: 6px;
  vertical-align: middle;
}

.ls-btn-row,
.ls-filter,
.ls-row-tools,
.ls-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ls-btn-row form,
.ls-row-tools form,
.ls-item-buttons form {
  margin: 0;
}

.ls-filter .buybtn {
  cursor: pointer;
  font-family: inherit;
}

.ls-btn {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f8f9fa;
  color: #333;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
}

.ls-btn:hover {
  background: #eee;
}

.ls-btn-red {
  color: #c62828;
}

.ls-btn-go {
  background: #f5ea47;
  border-color: #e0d530;
  color: #000;
  font-weight: bold;
}

.ls-btn-go:hover {
  background: #ede13a;
}

.ls-btn.is-on {
  background: #fff8c4;
  border-color: #e0c200;
}

.ls-admin input[type="number"],
.ls-admin input[type="search"],
.ls-admin input[type="datetime-local"],
.ls-admin select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95em;
  box-sizing: border-box;
}

.ls-filter input[type="search"] {
  width: 180px;
}

/* Smaller cards for the round tabs */
.ls-grid-admin {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 20px;
}

.ls-grid-admin .ls-item-art {
  position: relative;
  height: 130px;
}

.ls-grid-admin .ls-flame {
  width: 90px;
  height: 90px;
}

.ls-grid-admin .ls-border {
  --ava: 58px;
}

.ls-grid-admin .ls-item-meta + .ls-item-meta {
  margin-top: -4px;
}

.ls-cost {
  margin-right: 6px;
  color: #333;
  font-weight: bold;
}

.ls-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #f5ea47;
  color: #000;
  font-size: 11px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 4px;
}

.ls-grid-admin .ls-item-buttons .ls-btn {
  font-size: 0.8em;
}

/* Pool table */
.ls-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.ls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}

.ls-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 2px solid #e8e8e8;
  white-space: nowrap;
}

.ls-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e8e8e8;
  vertical-align: middle;
}

.ls-table tr.is-archived td {
  opacity: 0.5;
}

.ls-item-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ls-thumb {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--r-bg, #f8f9fa);
  border-radius: 6px;
  overflow: hidden;
}

.ls-thumb .ls-flame {
  width: 40px;
  height: 40px;
}

.ls-thumb .ls-border {
  --ava: 26px;
}

.ls-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #555;
  font-size: 0.8em;
  white-space: nowrap;
}

.ls-tag-live {
  background: #e3f5e4;
  color: #2e7d32;
}

.ls-tag-next {
  background: #fff8c4;
  color: #6d5d00;
}

.ls-show-removed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

/* Forms inside popups */
.ls-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
}

.ls-form label {
  font-weight: bold;
  font-size: 0.9em;
  margin-top: 6px;
}

.ls-form > select,
.ls-form-pair input {
  width: 100%;
}

.ls-form p {
  margin: 2px 0 6px;
}

.ls-form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ls-form-pair label {
  display: block;
  margin-bottom: 4px;
}

.ls-form-preview {
  height: 130px;
  margin-top: 8px;
  background: #f8f9fa;
}

.ls-form-preview .ls-flame {
  width: 100px;
  height: 100px;
}

.ls-form-preview .ls-border {
  --ava: 60px;
}

.ls-inline input[type="number"] {
  width: 70px;
}

@media (max-width: 480px) {
  .ls-grid,
  .ls-grid-featured,
  .ls-grid-admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .ls-item-art,
  .ls-grid-featured .ls-item-art {
    height: 140px;
  }
  .ls-flame,
  .ls-grid-featured .ls-flame {
    width: 100px;
    height: 100px;
  }
  .ls-border,
  .ls-grid-featured .ls-border {
    --ava: 62px;
  }
  .ls-filter input[type="search"] {
    width: 100%;
  }
}
