/* =========================================================
   فليبر FLIPR — نظام التصميم (إعادة بناء)
   هوية ليمونية نابضة، تجربة أبسط وأنظف، RTL، موبايل أولاً
   ========================================================= */

:root {
  /* محايدات دافئة */
  --bg: #f5f6f0;
  --bg-soft: #eceee3;
  --surface: #ffffff;
  --surface-2: #fbfcf7;
  --ink: #14160f;
  --ink-soft: #595e4f;
  --ink-faint: #969c86;
  --line: #e7e9dd;
  --line-soft: #f0f1ea;

  /* العلامة — ليموني */
  --brand: #c4e000;
  --brand-2: #d6ee3a;
  --brand-deep: #5f7400;
  --brand-ink: #161a05;
  --grad-brand: linear-gradient(135deg, #d6ee3a 0%, #c4e000 100%);
  --grad-dark: linear-gradient(165deg, #26291f 0%, #0c0d08 100%);

  /* دلالات */
  --like: #93b200;
  --like-soft: #eef6c9;
  --nope: #23251f;
  --nope-soft: #ececea;
  --sponsor: #ffae00; /* شريك مدفوع */
  --sponsor-soft: #fff2d6;
  --quiz: #7b61ff; /* كويز */
  --quiz-soft: #ece8ff;
  --quiz-deep: #4a2fd6;
  --info: #1f8fff;
  --danger: #e5484d;
  --gold: #c4e000;

  /* أبعاد */
  --radius: 22px;
  --radius-sm: 14px;
  --radius-lg: 30px;
  --radius-xl: 38px;
  --shadow-card: 0 22px 55px -16px rgba(15, 17, 10, 0.34),
    0 8px 20px -10px rgba(15, 17, 10, 0.18);
  --shadow-soft: 0 10px 30px -12px rgba(15, 17, 10, 0.18);
  --shadow-pop: 0 16px 40px -10px rgba(15, 17, 10, 0.28);
  --maxw: 480px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 0.8, 0.27, 1);
}

.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.qr-svg { display: block; border-radius: 8px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Tajawal", "Cairo", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--brand); color: var(--brand-ink); }

/* الحاوية بحجم الجوال */
.app {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 481px) {
  body {
    background: radial-gradient(120% 120% at 50% 0%, #20231a 0%, #0c0d08 70%);
    display: flex; align-items: center; justify-content: center; padding: 20px 0;
  }
  .app {
    min-height: min(880px, calc(100dvh - 40px));
    height: min(880px, calc(100dvh - 40px));
    border-radius: 40px;
    box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }
}

.screen { display: none; flex: 1; flex-direction: column; min-height: 0; }
.screen.active { display: flex; animation: screenIn 0.32s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ أزرار عامة ============ */
.btn-primary {
  width: 100%; padding: 16px; border-radius: var(--radius-sm);
  background: var(--grad-brand); color: var(--brand-ink);
  font-size: 16px; font-weight: 800; letter-spacing: 0.2px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 24px -8px rgba(150, 178, 0, 0.6);
  transition: transform 0.15s var(--ease), box-shadow 0.2s, opacity 0.2s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
.btn-primary .ic { font-size: 19px; }
.btn-ghost {
  width: 100%; padding: 13px; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-soft); font-size: 15px; font-weight: 700;
  transition: background 0.2s;
}
.btn-ghost:active { background: var(--bg-soft); }
.btn-dark {
  width: 100%; padding: 15px; border-radius: var(--radius-sm);
  background: var(--nope); color: #fff; font-size: 15px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s var(--ease);
}
.btn-dark:active { transform: scale(0.97); }
.link-btn {
  background: var(--bg-soft); color: var(--ink); border-radius: 30px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.link-btn:active { background: var(--line); }

/* ============ شاشات الدخول (هاتف / OTP / موقع) ============ */
.auth {
  position: relative; flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 26px 22px calc(26px + var(--safe-b));
  text-align: center; overflow: hidden;
}
.auth-emoji-bg { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; z-index: 0; }
.auth-emoji-bg span {
  position: absolute; font-size: 26px; color: var(--brand-deep); opacity: 0.12;
}
.auth > * { position: relative; z-index: 1; }
.brand-logo { object-fit: contain; }
.brand-logo.lg { width: 88px; height: 88px; margin-bottom: 14px; filter: drop-shadow(0 6px 14px rgba(15,17,10,.14)); }
.brand-logo.sm { width: 34px; height: 34px; }
.auth h1 { font-size: 34px; font-weight: 900; line-height: 1.18; margin: 0 0 10px; letter-spacing: -0.5px; }
.auth .tagline { font-size: 15px; color: var(--ink-soft); max-width: 320px; line-height: 1.7; margin: 0 0 26px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: var(--radius); padding: 22px 20px;
  box-shadow: var(--shadow-soft); border: 1px solid var(--line-soft); text-align: right;
}
.auth-card h2 { font-size: 19px; font-weight: 800; margin: 0 0 4px; }
.auth-card .sub { font-size: 13.5px; color: var(--ink-faint); margin: 0 0 16px; }
.phone-field {
  display: flex; align-items: center; gap: 8px; background: var(--bg-soft);
  border: 2px solid transparent; border-radius: var(--radius-sm); padding: 4px 6px; margin-bottom: 14px;
  transition: border-color 0.2s, background 0.2s; direction: ltr;
}
.phone-field:focus-within { border-color: var(--brand); background: #fff; }
.phone-field .cc { font-size: 15px; font-weight: 800; color: var(--ink-soft); padding: 0 8px; white-space: nowrap; }
.phone-field input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 19px; font-weight: 800; letter-spacing: 2px; padding: 12px 4px; color: var(--ink); direction: ltr;
}
.phone-field input::placeholder { color: var(--ink-faint); letter-spacing: 1px; font-weight: 600; }

.otp-boxes { display: flex; gap: 10px; direction: ltr; justify-content: center; margin-bottom: 12px; }
.otp-boxes input {
  width: 58px; height: 66px; text-align: center; font-size: 28px; font-weight: 900;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft);
  outline: none; color: var(--ink); transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.otp-boxes input:focus { border-color: var(--brand); background: #fff; transform: translateY(-2px); }
.otp-boxes input.filled { border-color: var(--brand); background: var(--like-soft); }
.otp-hint { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-bottom: 14px; }
.otp-hint b { color: var(--brand-deep); font-size: 14px; letter-spacing: 2px; }
.resend { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 12px; }
.resend button { color: var(--brand-deep); font-weight: 800; }

.how-strip {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  margin-top: 24px; font-size: 12px; color: var(--ink-soft);
}
.how-strip .hs-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.how-strip .hs-item .ic { color: var(--brand-deep); font-size: 15px; }
.how-strip .hs-sep { color: var(--ink-faint); }
.legal { font-size: 11px; color: var(--ink-faint); margin-top: 20px; max-width: 300px; line-height: 1.6; }

/* خطوة الموقع */
.loc-options { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 6px; }
.loc-detect {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  background: var(--grad-dark); color: #fff; border-radius: var(--radius-sm); padding: 15px 16px;
  transition: transform 0.15s var(--ease);
}
.loc-detect:active { transform: scale(0.98); }
.loc-detect .ld-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.loc-detect > span:last-child { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.loc-detect .ld-t { display: block; font-weight: 800; font-size: 15px; }
.loc-detect .ld-s { display: block; font-size: 12px; opacity: 0.7; }
.loc-or { text-align: center; font-size: 12px; color: var(--ink-faint); margin: 4px 0; position: relative; }
.city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.city-tile {
  background: var(--bg-soft); border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 16px 12px; text-align: center; font-weight: 800; font-size: 15px; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all 0.18s var(--ease);
}
.city-tile .ic { font-size: 22px; color: var(--brand-deep); }
.city-tile .ct-c { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.city-tile:active { transform: scale(0.97); }
.city-tile.on { border-color: var(--brand); background: var(--like-soft); }

/* ============ Topbar ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; gap: 10px; flex-shrink: 0;
}
.topbar .logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 17px; }
.loc-chip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 30px; padding: 7px 12px; font-weight: 800; font-size: 13.5px;
  box-shadow: var(--shadow-soft); transition: transform 0.15s;
}
.loc-chip:active { transform: scale(0.96); }
.loc-chip .pin { color: var(--brand-deep); font-size: 15px; }
.loc-chip .chevD { color: var(--ink-faint); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill {
  height: 38px; min-width: 38px; padding: 0 12px; border-radius: 30px; background: var(--surface);
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 800; font-size: 14px; box-shadow: var(--shadow-soft); transition: transform 0.15s;
}
.pill:active { transform: scale(0.94); }
.pill .ico { font-size: 17px; }
.pill.points .ico { color: var(--brand-deep); }
.ghost-pill { color: var(--ink-soft); }

/* فلاتر */
.filter-bar { padding: 2px 14px 8px; flex-shrink: 0; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 30px; background: var(--surface);
  border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: all 0.16s var(--ease);
}
.chip .ic { font-size: 15px; }
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--nope); border-color: var(--nope); color: #fff; }

/* ============ مكدّس البطاقات ============ */
.deck-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 16px 0; }
.deck { position: relative; flex: 1; min-height: 0; }

.card {
  position: absolute; inset: 0; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-card); will-change: transform;
  cursor: grab; user-select: none; touch-action: pan-y; display: flex; flex-direction: column;
  transform-origin: center bottom; border: 1px solid rgba(255,255,255,.5);
}
.card:active { cursor: grabbing; }
.card .photo { position: absolute; inset: 0; background-size: cover; background-position: center; }
.card .photo.noimg { background: var(--grad-dark); display: grid; place-items: center; }
.card .photo.noimg .emoji { font-size: 64px; color: rgba(255,255,255,.25); }
.card .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,9,5,.92) 0%, rgba(8,9,5,.55) 32%, rgba(8,9,5,.05) 56%, rgba(8,9,5,0) 75%);
}
.card-top { position: absolute; top: 0; right: 0; left: 0; padding: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; z-index: 2; }
.cat-chip {
  background: rgba(255,255,255,.92); color: var(--ink); font-weight: 800; font-size: 12px;
  padding: 6px 12px; border-radius: 30px; backdrop-filter: blur(6px);
}
.discount-badge {
  background: var(--grad-brand); color: var(--brand-ink); font-weight: 900; font-size: 17px;
  padding: 8px 14px; border-radius: 16px; box-shadow: 0 6px 16px -4px rgba(150,178,0,.7);
  display: inline-flex; align-items: center; gap: 3px;
}
.sponsor-tag {
  background: var(--sponsor); color: #2a1c00; font-weight: 900; font-size: 11px;
  padding: 6px 11px; border-radius: 30px; display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 4px 12px -2px rgba(255,174,0,.6);
}
.sponsor-tag .ic { font-size: 13px; }

.card-body { position: relative; z-index: 2; margin-top: auto; padding: 18px 18px 20px; color: #fff; }
.card-body .rest { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; opacity: 0.92; margin-bottom: 6px; }
.card-body .rest .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(196,224,0,.25); }
.card-body h3 { font-size: 22px; font-weight: 900; line-height: 1.28; margin: 0 0 7px; letter-spacing: -0.3px; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.card-body .desc { font-size: 13.5px; line-height: 1.55; opacity: 0.85; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.meta-tag {
  display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.16);
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.16);
  padding: 6px 10px; border-radius: 30px; font-size: 11.5px; font-weight: 700;
}
.meta-tag .ic { font-size: 13px; }
.meta-tag.qty { background: rgba(196,224,0,.22); border-color: rgba(196,224,0,.4); }
.meta-tag.qty.low { background: rgba(229,72,77,.3); border-color: rgba(229,72,77,.5); color: #ffd9da; }
.meta-tag.off { background: rgba(255,174,0,.22); border-color: rgba(255,174,0,.4); }

/* أختام السحب */
.stamp {
  position: absolute; top: 30px; z-index: 5; font-weight: 900; font-size: 26px;
  padding: 8px 18px; border-radius: 14px; border: 4px solid; opacity: 0;
  display: inline-flex; align-items: center; gap: 8px; transition: opacity 0.1s; pointer-events: none;
}
.stamp .ic { font-size: 26px; }
.stamp.like { right: 22px; transform: rotate(14deg); color: var(--brand); border-color: var(--brand); background: rgba(20,22,15,.4); }
.stamp.nope { left: 22px; transform: rotate(-14deg); color: #ff5a5f; border-color: #ff5a5f; background: rgba(20,22,15,.4); }

/* بطاقة الراعي — إطار ذهبي خفيف */
.card.is-sponsored { box-shadow: 0 22px 55px -16px rgba(255,174,0,.4), var(--shadow-card); }
.card.is-sponsored::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); border: 2px solid rgba(255,174,0,.55); pointer-events: none; z-index: 3; }

/* بطاقة البراند (خارج المطاعم) */
.card.is-brand .brand-canvas {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px; text-align: center;
}
.card.is-brand .brand-logo-box {
  width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center;
  font-size: 44px; color: #fff; box-shadow: 0 12px 30px -8px rgba(0,0,0,.3);
}
.card.is-brand .brand-name { font-size: 15px; font-weight: 800; color: rgba(255,255,255,.9); }
.card.is-brand .brand-deal { font-size: 26px; font-weight: 900; color: #fff; line-height: 1.3; max-width: 80%; }
.card.is-brand .ext-badge {
  position: absolute; top: 16px; right: 16px; z-index: 4; background: rgba(255,255,255,.92);
  color: var(--ink); font-weight: 800; font-size: 11px; padding: 6px 11px; border-radius: 30px;
  display: inline-flex; align-items: center; gap: 4px;
}

/* بطاقة الكويز */
.card.is-quiz { background: linear-gradient(165deg, #6b4dff 0%, #4a2fd6 100%); }
.quiz-canvas { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; padding: 26px 22px; color: #fff; }
.quiz-spark { position: absolute; inset: 0; opacity: 0.5; }
.quiz-spark span { position: absolute; color: #fff; opacity: 0.14; }
.quiz-badge {
  align-self: flex-start; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
  padding: 7px 13px; border-radius: 30px; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; gap: 6px;
}
.quiz-q { font-size: 24px; font-weight: 900; line-height: 1.4; margin: 20px 0 18px; }
.quiz-reward-hint { font-size: 13px; opacity: 0.85; margin-bottom: 14px; display: inline-flex; align-items: center; gap: 6px; }
.quiz-reward-hint b { color: var(--brand); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.quiz-opt {
  width: 100%; text-align: right; background: rgba(255,255,255,.14); border: 1.5px solid rgba(255,255,255,.22);
  border-radius: 14px; padding: 14px 16px; font-weight: 800; font-size: 15px; color: #fff;
  display: flex; align-items: center; gap: 10px; transition: all 0.16s var(--ease);
}
.quiz-opt .ix { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.quiz-opt:active { transform: scale(0.98); }
.quiz-opt.correct { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.quiz-opt.correct .ix { background: rgba(0,0,0,.15); }
.quiz-opt.wrong { background: rgba(229,72,77,.85); border-color: #ff5a5f; }
.quiz-opt.dim { opacity: 0.4; }

/* أزرار القبول/الرفض */
.actions {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 16px 0 14px; flex-shrink: 0;
}
.act-btn {
  border-radius: 50%; display: grid; place-items: center; background: var(--surface);
  box-shadow: var(--shadow-pop); transition: transform 0.16s var(--ease); border: 1px solid var(--line-soft);
}
.act-btn:active { transform: scale(0.88); }
.act-btn.lg { width: 64px; height: 64px; font-size: 28px; }
.act-btn.sm { width: 50px; height: 50px; font-size: 20px; position: relative; }
.act-btn.nope { color: var(--nope); }
.act-btn.like { color: var(--like); background: var(--nope); }
.act-btn.like .ic { color: var(--brand); }
.act-btn.rewind { color: var(--ink-soft); }
.act-btn.info { color: var(--info); }
.act-btn:disabled { opacity: 0.4; }
.act-btn .free-tag {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--brand-ink); font-size: 9px; font-weight: 900;
  padding: 2px 6px; border-radius: 30px; white-space: nowrap;
}

/* حالة المكدّس الفارغ */
.deck-empty {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
.deck-empty.show { display: flex; }
.deck-empty .big-emoji { width: 84px; height: 84px; border-radius: 26px; background: var(--bg-soft); display: grid; place-items: center; font-size: 40px; color: var(--brand-deep); margin-bottom: 16px; }
.deck-empty h3 { font-size: 21px; font-weight: 900; margin: 0 0 8px; }
.deck-empty p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 14px; max-width: 300px; }
.deck-empty .hint { font-size: 13px; color: var(--ink-faint); }
.countdown-big { font-size: 34px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 1px; margin: 6px 0 12px; direction: ltr; }

/* ============ التبويبات السفلية ============ */
.tabbar {
  display: flex; gap: 6px; padding: 10px 16px calc(12px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line); flex-shrink: 0;
}
.tabbar button {
  flex: 1; padding: 10px; border-radius: var(--radius-sm); font-weight: 800; font-size: 13.5px;
  color: var(--ink-faint); display: inline-flex; align-items: center; justify-content: center; gap: 7px; position: relative;
  transition: color 0.18s, background 0.18s;
}
.tabbar button .tico { font-size: 19px; }
.tabbar button.active { color: var(--ink); background: var(--bg-soft); }
.tabbar button.active .tico { color: var(--brand-deep); }
.tab-badge {
  position: absolute; top: 4px; right: 18px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 30px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 900;
  display: grid; place-items: center;
}

/* ============ المحفظة ============ */
.wallet-head { padding: 16px 18px 8px; }
.wallet-head h2 { font-size: 20px; font-weight: 900; margin: 0 0 4px; display: inline-flex; align-items: center; gap: 8px; }
.wallet-head h2 .ic { color: var(--brand-deep); }
.wallet-head p { font-size: 13px; color: var(--ink-faint); margin: 0; }
.wallet-list { flex: 1; overflow-y: auto; padding: 8px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.wallet-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft);
  border: 1px solid var(--line-soft); display: flex; flex-direction: column;
}
.wallet-card.expired { opacity: 0.55; }
.wc-main { display: flex; gap: 0; }
.wc-img { width: 108px; flex-shrink: 0; background-size: cover; background-position: center; background-color: var(--bg-soft); }
.wc-body { flex: 1; padding: 13px 14px; min-width: 0; }
.wc-body .rest { font-size: 12.5px; font-weight: 800; color: var(--brand-deep); margin-bottom: 3px; }
.wc-body h4 { font-size: 15.5px; font-weight: 800; margin: 0 0 8px; line-height: 1.35; }
.wc-disc { display: inline-flex; align-items: center; background: var(--like-soft); color: var(--brand-deep); font-weight: 900; font-size: 13px; padding: 4px 10px; border-radius: 30px; margin-bottom: 8px; }
.wc-timer { font-size: 12.5px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.wc-timer .ic { font-size: 14px; }
.wc-timer b { color: var(--ink); direction: ltr; }
.wc-timer.urgent { color: var(--danger); }
.wc-timer.urgent b { color: var(--danger); }
.wc-redeem-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px dashed var(--line);
  background: var(--surface-2);
}
.wc-qr { width: 64px; height: 64px; flex-shrink: 0; }
.wc-code-block { flex: 1; min-width: 0; }
.wc-code-label { font-size: 11px; color: var(--ink-faint); font-weight: 700; margin-bottom: 2px; }
.wc-code { font-size: 22px; font-weight: 900; letter-spacing: 2px; direction: ltr; color: var(--ink); }
.wc-show-btn { background: var(--nope); color: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wc-foot { display: flex; gap: 8px; padding: 0 14px 13px; }
.wc-map { flex: 1; text-align: center; background: var(--bg-soft); color: var(--ink); border-radius: 12px; padding: 10px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.wc-ext { flex: 1; text-align: center; background: var(--like-soft); color: var(--brand-deep); border-radius: 12px; padding: 10px; font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }

.wallet-empty, .m-empty { text-align: center; padding: 50px 24px; color: var(--ink-faint); margin: auto; }
.wallet-empty .big-emoji { width: 80px; height: 80px; border-radius: 24px; background: var(--bg-soft); display: grid; place-items: center; font-size: 38px; color: var(--brand-deep); margin: 0 auto 16px; }
.wallet-empty h3 { font-size: 19px; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.wallet-empty p { font-size: 14px; line-height: 1.6; max-width: 280px; margin: 0 auto; }

/* ============ المودالات / الشيتات ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12,13,8,.5); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50; opacity: 0; visibility: hidden;
  transition: opacity 0.28s, visibility 0.28s;
}
.modal-backdrop.show { opacity: 1; visibility: visible; }
@media (min-width: 481px) { .modal-backdrop { align-items: center; } }
.sheet {
  width: 100%; max-width: var(--maxw); background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 22px calc(24px + var(--safe-b)); box-shadow: 0 -10px 40px -10px rgba(0,0,0,.3);
  transform: translateY(100%); transition: transform 0.34s var(--ease); max-height: 92vh; overflow-y: auto;
}
.modal-backdrop.show .sheet { transform: none; }
@media (min-width: 481px) { .sheet { border-radius: var(--radius-xl); max-width: 420px; } }
.grab { width: 40px; height: 5px; border-radius: 30px; background: var(--line); margin: 0 auto 16px; }
.sheet h3 { font-size: 21px; font-weight: 900; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.sheet h3 .ic { color: var(--brand-deep); }
.sheet .sub { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 18px; }

/* مودال الكشف (reveal) */
.sheet.reveal { text-align: center; }
.ok-emoji {
  width: 74px; height: 74px; border-radius: 24px; background: var(--like-soft); color: var(--brand-deep);
  display: grid; place-items: center; font-size: 36px; margin: 4px auto 14px; animation: pop 0.4s var(--ease);
}
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.reveal .rest-name { font-size: 15px; font-weight: 800; color: var(--ink); margin: 0 0 4px; }
.reveal .reveal-disc { font-size: 28px; font-weight: 900; color: var(--brand-deep); margin: 6px 0; }
.timer-row { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); background: var(--bg-soft); padding: 7px 14px; border-radius: 30px; margin: 6px 0 16px; }
.timer-row b { color: var(--ink); direction: ltr; font-variant-numeric: tabular-nums; }
.reveal-qr-box {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.reveal-qr { padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-soft); }
.reveal-code-line { display: flex; align-items: center; gap: 10px; }
.reveal-code { font-size: 26px; font-weight: 900; letter-spacing: 3px; direction: ltr; color: var(--ink); }
.copy-mini { background: var(--bg-soft); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 800; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.reveal-note { font-size: 12.5px; color: var(--ink-faint); line-height: 1.6; margin: 0 0 16px; }
.key-map { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); background: var(--bg-soft); border-radius: 12px; padding: 11px; width: 100%; text-decoration: none; margin-bottom: 10px; }

/* بوّابة الراحة (rest gate) */
.sheet.rest { text-align: center; }
.rest-emoji { width: 78px; height: 78px; border-radius: 26px; background: var(--quiz-soft); color: var(--quiz-deep); display: grid; place-items: center; font-size: 38px; margin: 4px auto 14px; }
.rest-choice { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.rest-q { background: var(--bg-soft); border-radius: var(--radius); padding: 18px; text-align: right; }
.rest-q .rq-text { font-weight: 800; font-size: 16px; margin-bottom: 14px; }
.rest-q-options { display: flex; flex-direction: column; gap: 9px; }
.rest-q-opt { width: 100%; text-align: right; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px; font-weight: 700; font-size: 14.5px; transition: all 0.16s var(--ease); }
.rest-q-opt:active { transform: scale(0.98); }
.rest-q-opt.correct { background: var(--like-soft); border-color: var(--brand); color: var(--brand-deep); }
.rest-q-opt.wrong { background: #fde8e8; border-color: var(--danger); color: var(--danger); }
.rest-wait { font-size: 13px; color: var(--ink-faint); }
.rest-wait .countdown-big { font-size: 30px; margin: 8px 0; }

/* كيف يعمل */
.how-steps { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 14px; }
.how-steps li { display: flex; gap: 14px; align-items: flex-start; }
.how-steps .step-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--like-soft); color: var(--brand-deep); display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.how-steps li > div { display: flex; flex-direction: column; }
.how-steps b { font-size: 15px; font-weight: 800; }
.how-steps span { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* مدن (شيت تغيير الموقع) */
.sheet .city-grid { margin-top: 8px; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: calc(86px + var(--safe-b)); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--nope); color: #fff; padding: 13px 20px; border-radius: 30px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-pop); z-index: 80; opacity: 0; visibility: hidden; transition: all 0.3s var(--ease);
  max-width: 88%; text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.success { background: #2f7d20; }
.toast.warn { background: #b3690a; }
.toast.error { background: var(--danger); }

/* كونفيتي بسيط */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; width: 9px; height: 14px; top: -20px; opacity: 0.9; animation: fall 1.6s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0; } }

/* أدوات */
.hidden { display: none !important; }
