/* כרטיסי גירוד — לובי + «הטופס שלי» (עיצוב תואם hub ספורט/צ'אנס) */

body.page-hub-scratch {
  /* גוון זהב מלא-חיים כמו ה-hub של הספורט (קטגוריית הגירוד אפורה, לכן לא נגזר ממנה) */
  --scratch-accent: #f5c518;
}

.index-home-hub--scratch { align-items: flex-start; }

/* יישור עליון אחיד (כמו צ'אנס/ספורט) — מונע מתיחת .main ל-100vh ובלוקים גבוהים */
@media (min-width: 769px) {
  body.page-hub-scratch .page-middle { align-items: flex-start !important; }
  body.page-hub-scratch .main { align-self: flex-start !important; }
  /* העמודה בגובה התוכן בלבד — לא נמתחת ע"י ה-hub */
  body.page-hub-scratch .index-home-hub--scratch { align-items: flex-start !important; }
  body.page-hub-scratch .index-home-hub--scratch .index-col--form.index-home-side {
    align-self: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
  }
  /* הבלוק לא גדל בתוך ה-aside (flex-column) — גובה תוכן בלבד, רוחב מלא */
  body.page-hub-scratch .index-home-hub--scratch .index-col--form.index-home-side > .index-my-form-block.index-home-card {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
  }
}

/* ===== כרטיס לובי (עמודה ראשית) ===== */
body.page-hub-scratch .index-home-hub--scratch .scratch-lobby.index-home-card {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--scratch-accent) 10%, rgba(255, 255, 255, 0.06)),
    color-mix(in srgb, var(--scratch-accent) 4%, rgba(255, 255, 255, 0.03))
  );
  border: 1px solid color-mix(in srgb, var(--scratch-accent) 22%, rgba(255, 255, 255, 0.1));
  border-inline-start: 3px solid color-mix(in srgb, var(--scratch-accent) 55%, transparent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.scratch-lobby { padding: clamp(14px, 2vw, 20px); }
.scratch-lobby__header { margin-bottom: 16px; }
.scratch-lobby__title { margin: 0; font-size: clamp(1.05rem, .9rem + .6vw, 1.35rem); font-weight: 800; color: #fff; }
.scratch-lobby__subtitle { margin: 4px 0 0; font-size: .85rem; color: rgba(255, 255, 255, .55); }
.scratch-lobby__empty { color: rgba(255, 255, 255, .55); padding: 24px 0; text-align: center; }

.scratch-rows { display: flex; flex-direction: column; gap: 12px; }

.scratch-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  transition: border-color .15s ease;
}
.scratch-row:hover { border-color: color-mix(in srgb, var(--scratch-accent) 45%, rgba(255, 255, 255, .1)); }

.scratch-row__media {
  position: relative; flex: none;
  width: 70px; height: 92px; align-self: center;
  border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--scratch-accent) 14%, transparent), rgba(0, 0, 0, .3));
}
.scratch-row__img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.scratch-row__ph { color: color-mix(in srgb, var(--scratch-accent) 80%, transparent); }
.scratch-row__ph svg { width: 48px; height: 48px; }
.scratch-row__stock {
  position: absolute; inset-block-start: 6px; inset-inline-end: 6px;
  font-size: .68rem; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .18);
  padding: 2px 7px; border-radius: 999px;
}

.scratch-row__content { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.scratch-row__info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.scratch-row__name { margin: 0; font-size: 1.05rem; font-weight: 800; color: #fff; }
.scratch-row__desc {
  margin: 0; font-size: .85rem; line-height: 1.4; color: rgba(255, 255, 255, .62);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.scratch-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 2px; }
.scratch-row__price { font-size: .92rem; font-weight: 800; color: var(--scratch-accent, #f5c518); }
.scratch-row__price span { color: rgba(255, 255, 255, .5); font-weight: 500; font-size: .8rem; }
.scratch-row__remain { font-size: .8rem; color: rgba(255, 255, 255, .6); }
.scratch-row__remain b { color: #fff; }

.scratch-row__action {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 152px; min-width: 132px;
}
.scratch-row__add {
  width: 100%; border: none; cursor: pointer; border-radius: 10px; padding: 11px 14px;
  font-size: .92rem; font-weight: 800; color: #1a1a1a; background: var(--scratch-accent, #f5c518);
  transition: filter .15s ease; white-space: nowrap;
}
.scratch-row__add:hover { filter: brightness(1.08); }
.scratch-row__add:disabled { opacity: .55; cursor: default; filter: none; }
.scratch-row__soldout { color: rgba(255, 255, 255, .45); font-size: .85rem; font-weight: 700; text-align: center; }

@media (max-width: 560px) {
  .scratch-row { padding: 10px; gap: 12px; align-items: flex-start; }
  .scratch-row__media { width: 70px; height: 92px; align-self: flex-start; }
  .scratch-row__content { flex-direction: column; align-items: stretch; gap: 10px; }
  .scratch-row__action { width: 100%; min-width: 0; }
}

/* ===== «הטופס שלי» — כרטיס hub (כמו צ'אנס/ספורט) ===== */
body.page-hub-scratch .index-home-hub--scratch .index-my-form-block.index-home-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--scratch-accent) 10%, rgba(255, 255, 255, 0.06)),
    color-mix(in srgb, var(--scratch-accent) 4%, rgba(255, 255, 255, 0.03))
  );
  border: 1px solid color-mix(in srgb, var(--scratch-accent) 22%, rgba(255, 255, 255, 0.1));
  border-inline-start: 3px solid color-mix(in srgb, var(--scratch-accent) 55%, transparent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: none;
}

body.page-hub-scratch .index-home-hub--scratch .index-my-form-head.index-my-form-title-bar {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--scratch-accent) 18%, rgba(0, 0, 0, 0.35)),
    color-mix(in srgb, var(--scratch-accent) 8%, rgba(0, 0, 0, 0.14))
  );
  border: 1px solid color-mix(in srgb, var(--scratch-accent) 16%, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
}

body.page-hub-scratch .index-home-hub--scratch .index-my-form-title .index-my-form-balance-value {
  color: color-mix(in srgb, var(--scratch-accent) 35%, #fff);
}

body.page-hub-scratch .index-home-hub--scratch .index-my-form-empty-icon {
  color: color-mix(in srgb, var(--scratch-accent) 45%, transparent);
}

body.page-hub-scratch .index-home-hub--scratch #index-my-form-content.index-my-form-desc,
body.page-hub-scratch .index-home-hub--scratch .index-my-form-desc {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* תוכן הטופס שלי בגידור — יושב מלמעלה, אין flex centering */
body.page-hub-scratch .index-home-hub--scratch #index-my-form-content.index-my-form-desc.index-my-form-content--has-scratch {
  display: block !important;
  min-height: 0 !important;
  align-items: unset !important;
  justify-content: unset !important;
  padding: 0;
  color: rgba(255, 255, 255, 0.88);
}

/* מצב ריק — block פשוט, ממורכז אופקית, צמוד למעלה (לא מרחף לאמצע) */
.scratch-empty {
  display: block !important;
  max-width: 340px; margin: 28px auto !important; padding: 8px 16px;
  text-align: center;
}
.scratch-empty .index-my-form-empty-icon { margin: 0 auto 14px; }
.scratch-empty[hidden] { display: none !important; }

/* ===== סל קנייה ===== */
.scratch-cart { display: flex; flex-direction: column; gap: 10px; }
.scratch-cart:not([hidden]) + .scratch-mine:not([hidden]) {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--scratch-accent) 14%, rgba(255, 255, 255, .1));
}
.scratch-cart__title {
  font-size: .9rem; font-weight: 800; color: #fff;
  padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--scratch-accent) 16%, rgba(0, 0, 0, 0.35)),
    color-mix(in srgb, var(--scratch-accent) 6%, rgba(0, 0, 0, 0.14))
  );
  border: 1px solid color-mix(in srgb, var(--scratch-accent) 18%, rgba(255, 255, 255, 0.1));
  text-align: center;
}
.scratch-cart__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scratch-cart__item {
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
}
.scratch-cart__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.scratch-cart__img {
  flex: none; width: 36px; height: 48px; border-radius: 7px; object-fit: cover; object-position: center top;
  border: 1px solid rgba(255, 255, 255, .12);
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--scratch-accent) 12%, rgba(0, 0, 0, .25));
  color: color-mix(in srgb, var(--scratch-accent) 80%, #fff); font-size: 18px;
}
.scratch-cart__name { flex: 1; min-width: 0; font-size: .9rem; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scratch-cart__rm {
  flex: none; width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .75); font-size: 18px; line-height: 1;
}
.scratch-cart__rm:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.scratch-cart__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scratch-cart__stepper {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px; padding: 4px 6px;
}
.scratch-cart__stepper button {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: none; background: rgba(255, 255, 255, .08); color: #fff;
  font-size: 16px; font-weight: 700; line-height: 1;
}
.scratch-cart__stepper button:hover { background: rgba(255, 255, 255, .16); }
.scratch-cart__stepper span { min-width: 22px; text-align: center; font-size: .95rem; font-weight: 800; color: #fff; }
.scratch-cart__line { font-size: .9rem; font-weight: 800; color: var(--scratch-accent, #f5c518); white-space: nowrap; }
.scratch-cart__total {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem; color: rgba(255, 255, 255, .7);
}
.scratch-cart__total b { font-size: 1.05rem; color: #fff; }
.scratch-cart__buy {
  width: 100%; border: none; cursor: pointer; border-radius: 10px; padding: 12px;
  font-size: .95rem; font-weight: 800; color: #1a1a1a; background: var(--scratch-accent, #f5c518);
  transition: filter .15s ease;
}
.scratch-cart__buy:hover { filter: brightness(1.08); }
.scratch-cart__buy:disabled { opacity: .6; cursor: default; }
.scratch-cart__msg { min-height: 16px; font-size: .78rem; color: #ff9a9a; text-align: center; }

/* ===== כרטיסים לגירוד ===== */
/* כיבוד התכונה hidden (גובר על display:flex) */
.scratch-cart[hidden], .scratch-mine[hidden], .scratch-empty[hidden] { display: none !important; }

.scratch-mine { display: flex; flex-direction: column; gap: 12px; }
.scratch-mine__count {
  font-size: .9rem; font-weight: 800; color: #fff;
  padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--scratch-accent) 16%, rgba(0, 0, 0, 0.35)),
    color-mix(in srgb, var(--scratch-accent) 6%, rgba(0, 0, 0, 0.14))
  );
  border: 1px solid color-mix(in srgb, var(--scratch-accent) 18%, rgba(255, 255, 255, 0.1));
  text-align: center;
}
.scratch-mine__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scratch-mine__item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  background: rgba(255, 255, 255, .04); font-size: .9rem; color: #fff;
}
.scratch-mine__no { display: flex; flex-direction: column; gap: 2px; }
.scratch-mine__no b { color: var(--scratch-accent, #f5c518); font-size: .95rem; }
.scratch-mine__id { font-size: .72rem; color: rgba(255, 255, 255, .45); font-weight: 600; }
.scratch-mine__go {
  text-decoration: none; font-weight: 800; color: #1a1a1a; font-size: .85rem;
  background: var(--scratch-accent, #f5c518); padding: 8px 20px; border-radius: 10px; white-space: nowrap;
  transition: filter .15s ease;
}
.scratch-mine__go:hover { filter: brightness(1.08); }
.scratch-mine__all {
  display: block; margin-top: 4px;
  color: var(--scratch-accent, #f5c518); font-weight: 700; font-size: .85rem;
  text-decoration: none; text-align: center;
}

@keyframes scratchNewFlash {
  0% { background: color-mix(in srgb, var(--scratch-accent) 28%, rgba(255, 255, 255, .04)); border-color: color-mix(in srgb, var(--scratch-accent) 60%, rgba(255, 255, 255, .1)); }
  100% { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); }
}
.scratch-mine__item--new { animation: scratchNewFlash 1.4s ease-out; }

