/* =====================================================================
   Huruf hijaiyyah
   Kartu huruf, papan, dan ubin untuk game huruf.
   ===================================================================== */

/* ===== huruf hijaiyyah ===== */

.hij-big {
  font-size: clamp(3.6rem,16vw,5.6rem);
  line-height: 1.7;
  color: var(--night);
}

.hij-opt {
  font-size: calc(2.6rem*var(--ar-s2,1));
  line-height: 1.6;
}

.hij-name {
  font-family: var(--f-disp);
  font-weight: 800;
  font-size: 2.3rem;
  color: var(--night);
  line-height: 1.2;
}

.hij-name.sm {
  font-size: 1.5rem;
}

.hij-hud {
  font-size: calc(2.8rem*var(--ar-s2,1));
  line-height: 1.5;
  color: var(--night);
}

.hij-chip {
  flex-direction: column;
  padding: 2px 14px 4px;
  min-width: 66px;
  gap: 0;
}

.hij-chip .hij-ch {
  font-size: calc(2.4rem*var(--ar-s2,1));
  line-height: 1.6;
}

.hij-chip small {
  font-size: .7rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.1;
}

.hijrow {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hij-g {
  font-size: 2.6rem;
  line-height: 1.5;
  min-width: 70px;
  text-align: center;
  color: var(--night);
}

.hijgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
  gap: 12px;
}

.hijcard {
  position: relative;
  background: #fff;
  border: 3px solid var(--line);
  border-bottom-width: 6px;
  border-radius: 20px;
  padding: 10px 8px 12px;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.hijcard b {
  font-family: var(--f-disp);
  font-size: 1.15rem;
}

.hijcard small {
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
}

.hij-lat {
  font-weight: 800;
  color: var(--mint-d);
}

.hij-no {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--star-e) center/contain no-repeat;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--f-disp);
  font-weight: 800;
  font-size: .72rem;
}

.hij-forms {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 2px dashed var(--line);
  width: 100%;
  justify-content: center;
}

.hij-forms>span {
  display: grid;
  justify-items: center;
}

.hij-forms .ar {
  font-size: 1.7rem;
  line-height: 1.6;
}

.hijentry {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: linear-gradient(#FFFDF3,#FFF3CF);
  border: 3px solid #D9B04A;
  border-bottom-width: 6px;
  border-radius: 20px;
  padding: 10px 16px;
  margin-bottom: 6px;
}

.hijentry .hij-big {
  font-size: 2rem;
  line-height: 1.5;
  min-width: 84px;
  text-align: center;
  white-space: nowrap;
}

.hijentry b {
  font-family: var(--f-disp);
  font-size: 1.15rem;
  display: block;
}

.hijentry small {
  color: var(--muted);
  font-weight: 700;
}

.hijentry .go {
  margin-left: auto;
  font-family: var(--f-disp);
  font-weight: 800;
  color: var(--mint-d);
  white-space: nowrap;
}

/* ular hijaiyyah */

.sn-hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  text-align: center;
}

.sn-strip {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.sn-strip i {
  font-style: normal;
  min-width: 28px;
  height: 32px;
  border-radius: 9px;
  background: #EEF3F0;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
}

.sn-strip i.ok {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: #0B5C40;
}

.sn-strip i.ok .ar {
  font-size: 1.1rem;
  line-height: 1.4;
}

.sn-strip i.bad {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: #8A1F23;
}

.sn-strip i.now {
  border-color: var(--sun);
  background: #FFF8DD;
}

.sn-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 1;
}

.sn-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: 3px solid var(--sun);
  background: #fff;
  touch-action: none;
}

.sn-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.88);
  border-radius: 18px;
  text-align: center;
  padding: 16px;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3,64px);
  grid-template-rows: repeat(2,56px);
  gap: 8px;
  justify-content: center;
  margin: 0 auto;
}

.dp {
  border-radius: 16px;
  background: #EAF6F0;
  border: 3px solid #BFDCCD;
  border-bottom-width: 6px;
  font-size: 1.3rem;
  color: var(--night);
  display: grid;
  place-items: center;
  touch-action: manipulation;
}

.dp:active {
  transform: translateY(3px);
  border-bottom-width: 3px;
}

.dp.up {
  grid-column: 2;
  grid-row: 1;
}

.dp.lf {
  grid-column: 1;
  grid-row: 2;
}

.dp.dn {
  grid-column: 2;
  grid-row: 2;
}

.dp.rt {
  grid-column: 3;
  grid-row: 2;
}

.hij-prog {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: var(--muted);
}

.hij-prog b {
  color: var(--night);
}

.hij-placed {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  direction: rtl;
  min-height: 46px;
  padding: 6px 8px;
  border: 3px dashed #E9C76B;
  border-radius: 16px;
  background: #FFFBEA;
}

.hij-placed .ar {
  font-size: 1.5rem;
  line-height: 1.5;
  min-width: 30px;
  text-align: center;
  background: var(--ok-bg);
  border-radius: 8px;
  color: #0B5C40;
}

.hij-pool {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 8px;
  direction: rtl;
}

.hij-tile {
  aspect-ratio: 1;
  border-radius: 14px;
  background: #E8F4EE;
  border: 3px solid #B8DCCB;
  border-bottom-width: 6px;
  display: grid;
  place-items: center;
  color: #0F4A3C;
  min-width: 0;
}

.hij-tile .ar {
  font-size: calc(1.9rem*var(--ar-s2,1));
  line-height: 1.4;
}

.hij-tile:active {
  transform: translateY(3px);
  border-bottom-width: 3px;
}

.hij-tile.shake {
  animation: shake .4s;
  border-color: var(--bad);
  background: var(--bad-bg);
}

.hij-tile.hint {
  border-color: var(--mint);
  background: #D4F3E6;
  box-shadow: 0 0 0 4px rgba(18,147,111,.3);
  animation: pulse 1s infinite;
}

@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
