@font-face { font-family: 'Thmanyah Sans'; src: url('/fonts/thmanyahsans-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url('/fonts/thmanyahsans-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url('/fonts/thmanyahsans-Black.otf') format('opentype'); font-weight: 900; font-display: swap; }
:root {
  --primary: #c51e26;
  --accent: #f2f0ee;
  --bg: #171213;
  --card: #241d1e;
  --text: #f4efe6;
  --muted: #ab9fa0;
  --line: rgba(255, 255, 255, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Thmanyah Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
}
button { font: inherit; cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 18px; border-radius: 14px;
  background: var(--card); color: var(--text); font-weight: 700; font-size: 16px;
  border: 1px solid var(--line); transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: transparent; }
.btn.accent { background: var(--accent); color: #1b1408; border-color: transparent; }
.btn svg { width: 20px; height: 20px; }

/* ---------- brand header ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; overflow: hidden; color: #fff;
}
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand .t1 { font-weight: 800; letter-spacing: .5px; }
.brand .t2 { font-size: 12px; color: var(--muted); }

/* ---------- dot-matrix display ---------- */
.matrix {
  background: radial-gradient(ellipse at center, #0b0e0d 0%, #050706 100%);
  border-radius: 16px; padding: 22px 14px 16px; border: 1px solid #000;
  box-shadow: inset 0 0 30px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.05);
  position: relative; overflow: hidden;
}
.matrix .grid { display: flex; justify-content: center; gap: 10px; direction: ltr; }
.matrix .digit { display: grid; grid-template-columns: repeat(5, var(--dot)); gap: var(--gap); }
.matrix .d { width: var(--dot); height: var(--dot); border-radius: 50%; background: #1c201e; }
.matrix .d.on { background: #fff6dd; box-shadow: 0 0 6px rgba(255, 230, 170, .9), 0 0 14px rgba(255, 200, 100, .35); }
.matrix .progress { display: flex; justify-content: center; gap: 6px; margin-top: 16px; direction: ltr; }
.matrix .progress span { width: 7px; height: 7px; border-radius: 50%; background: #2a2f2c; transition: background .25s; }
.matrix .progress span.on { background: #fff6dd; box-shadow: 0 0 6px rgba(255,230,170,.8); }
.matrix.ready .d.on { background: #b9ffcf; box-shadow: 0 0 6px rgba(140,255,180,.9), 0 0 16px rgba(80,255,140,.4); }
.matrix.ready .progress span { background: #b9ffcf; }

/* ---------- sheets (bottom modals) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; inset: auto 0 0 0; z-index: 50; max-height: 92vh; height: 92vh;
  background: #f5ede1; color: #2a1f17; border-radius: 22px 22px 0 0;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet.open { transform: none; }
.sheet .sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.sheet .close { background: rgba(0,0,0,.07); color: inherit; padding: 8px 14px; border-radius: 20px; font-weight: 600; }
.sheet .sheet-body { overflow-y: auto; padding: 0 16px 24px; flex: 1; }

/* ---------- ready banner ---------- */
.ready-banner {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 30px; text-align: center; background: var(--primary); animation: flash 1s infinite;
}
.ready-banner h1 { margin: 0; font-size: 34px; }
.ready-banner .num { font-size: 96px; font-weight: 800; line-height: 1; }
.ready-banner p { margin: 0; opacity: .9; }
.ready-banner .btn { max-width: 320px; background: #fff; color: #111; }
@keyframes flash { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
