/* =====================================================================
   Layar game
   Tampilan soal, pilihan jawaban, umpan balik, dan hasil.
   ===================================================================== */

/* ===== game screen ===== */

.ghead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.ghead h2 {
  font-size: 1.15rem;
  color: var(--night);
  text-align: center;
  line-height: 1.1;
}

.ghead small {
  display: block;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  font-size: .78rem;
}

.score {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  background: #FFF4CC;
  border: 2px solid var(--sun);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 800;
}

.prog {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.prog i {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: var(--line);
}

.prog i.done {
  background: var(--mint);
}

.prog i.miss {
  background: var(--coral);
}

.prog i.now {
  background: var(--sun);
}

.timer {
  height: 10px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.timer>i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg,var(--coral),var(--sun));
  border-radius: 99px;
}

.stage {
  background: #fff;
  border: 4px solid var(--sun);
  border-radius: 26px;
  padding: 20px 16px;
  box-shadow: 0 10px 28px rgba(31,42,104,.12);
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 16px;
}

.q-text {
  text-align: center;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.05rem;
}

.hint {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: .88rem;
}

.tag {
  display: inline-block;
  background: #E7F8F3;
  color: var(--mint-d);
  font-weight: 800;
  border-radius: 99px;
  padding: 3px 14px;
  font-size: .85rem;
}

/* mushaf card — the memorable element */

.mushaf {
  position: relative;
  background: linear-gradient(#fff,#fffdf6);
  border: 3px solid #E9C76B;
  border-radius: 22px;
  padding: 12px 16px;
  box-shadow: inset 0 0 0 5px #fff,inset 0 0 0 7px #F3DFA2;
  text-align: center;
  color: #12313a;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.mushaf.blur .ar {
  filter: blur(9px);
}

.mushaf .badge-n {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--night);
  color: #fff;
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: .78rem;
  border-radius: 99px;
  padding: 2px 12px;
  white-space: nowrap;
}

.words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 10px;
  direction: rtl;
}

.opts {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.opts.c3 {
  grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr));
}

.opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #EAF6F0;
  border: 3px solid #BFDCCD;
  border-bottom-width: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  min-height: 60px;
  transition: transform .08s;
}

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

.opt.txt {
  font-weight: 700;
  font-size: .98rem;
  line-height: 1.4;
}

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

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

.opt.dim {
  opacity: .55;
}

.opt .opt-ar {
  font-size: calc(1.3rem*var(--ar-s2,1));
}

.chip-w {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 2px 14px;
  border-radius: 16px;
  background: #E8F4EE;
  border: 3px solid #B8DCCB;
  border-bottom-width: 6px;
  color: #0F4A3C;
  font-size: calc(1.6rem*var(--ar-s2,1));
  line-height: 2;
}

.chip-w:active {
  transform: translateY(3px);
}

.chip-w.used {
  opacity: .25;
  pointer-events: none;
}

.tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  direction: rtl;
}

.slotrow {
  min-height: 76px;
  border: 3px dashed #E9C76B;
  border-radius: 20px;
  padding: 10px;
  background: #FFFBEA;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
  align-items: center;
  direction: rtl;
}

.slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 56px;
  padding: 0 12px;
  border-radius: 14px;
  border: 3px dashed var(--sun-d);
  background: #FFF3C4;
  color: #7a5200;
  font-size: calc(1.5rem*var(--ar-s2,1));
  line-height: 1.9;
}

.slot.fill {
  border-style: solid;
  background: #fff;
  color: #12313a;
}

.slot.ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.slot.bad {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.seq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 16px;
  background: #EAF6F0;
  border: 3px solid #B8DCCB;
  border-bottom-width: 6px;
  text-align: center;
}

.seq-item .ar {
  flex: 1;
}

.seq-item.used {
  opacity: .25;
  pointer-events: none;
}

.seq-n {
  flex: none;
  background: var(--night);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: .9rem;
}

.seq-item.ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.seq-item.bad {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.listen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.mic {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 2.2rem;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 5px solid #fff;
  box-shadow: 0 8px 0 var(--coral-d),0 14px 24px rgba(0,0,0,.2);
}

.mic.rec {
  animation: pulse 1s infinite;
  background: var(--mint);
  box-shadow: 0 8px 0 var(--mint-d);
}

@keyframes pulse {
  50% {
    transform: scale(1.08);
  }
}

/* memory cards */

.mgrid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

@media(min-width:620px) {
  .mgrid.n8,
  .mgrid.n12 {
    grid-template-columns: repeat(4,1fr);
  }
}

.mcard {
  perspective: 700px;
  height: 132px;
  min-width: 0;
}

.mcard .in {
  display: block;
}

.mgrid.n4 {
  grid-template-columns: repeat(2,1fr);
  max-width: 420px;
}

.mgrid.n8 {
  grid-template-columns: repeat(2,1fr);
}

.mgrid.n12 {
  grid-template-columns: repeat(3,1fr);
}

.chip-w.ok {
  background: var(--ok-bg);
  border-color: var(--ok);
}

.chip-w.bad {
  background: var(--bad-bg);
  border-color: var(--bad);
}

.mcard .in {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .45s;
  transform-style: preserve-3d;
}

.mcard.up .in {
  transform: rotateY(180deg);
}

.mcard .f,
.mcard .b {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: grid;
  place-items: center;
  padding: 6px;
  text-align: center;
  overflow: hidden;
}

.mcard .b {
  background: repeating-linear-gradient(45deg,var(--mint) 0 10px,#27C4A5 10px 20px);
  border: 3px solid var(--mint-d);
  border-bottom-width: 6px;
  font-size: 2rem;
}

.mcard .f {
  transform: rotateY(180deg);
  background: #fff;
  border: 3px solid var(--sun);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.3;
}

.mcard .f.arf {
  border-color: #9ADFCD;
}

.mcard.done .f {
  background: var(--ok-bg);
  border-color: var(--ok);
}

.mcard .f .ar {
  font-size: 1rem;
  line-height: 1.8;
  padding: 0;
}

/* fading words */

.ghost {
  display: inline-block;
  min-width: 44px;
  height: 52px;
  border-radius: 12px;
  border: 3px dashed #B9C3E6;
  background: #EEF3F0;
  vertical-align: middle;
}

.ghost.peek {
  border: 0;
  background: none;
  height: auto;
}

/* feedback */

.fb {
  border-radius: 22px;
  padding: 14px;
  border: 3px solid;
  display: grid;
  gap: 10px;
  animation: up .25s ease-out;
}

.fb.good {
  background: var(--ok-bg);
  border-color: var(--ok);
}

.fb.oops {
  background: #FFF4E5;
  border-color: #F4A340;
}

.fb h3 {
  font-size: 1.25rem;
}

.vrow {
  background: #fff;
  border-radius: 16px;
  padding: 8px 12px;
  border: 2px solid rgba(0,0,0,.06);
  display: grid;
  gap: 2px;
}

.vrow .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: .8rem;
  color: var(--muted);
}

.vrow .tr {
  font-size: .88rem;
  color: #3E5A57;
  font-weight: 600;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sun);
  color: #3b2b00;
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: .85rem;
  border-bottom: 3px solid var(--sun-d);
}

/* results */

.result {
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
  max-width: 460px;
  margin: 0 auto;
  padding: 8px 0;
}

.big-stars {
  font-size: 3.2rem;
  letter-spacing: 6px;
}

.big-stars span.off {
  filter: grayscale(1) opacity(.3);
}

.stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat {
  background: #FFF8DD;
  border: 2px solid var(--sun);
  border-radius: 16px;
  padding: 8px 16px;
  font-weight: 800;
}

/* learn */

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

.scard {
  text-align: left;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  border-bottom-width: 6px;
}

.scard:active {
  transform: translateY(3px);
}

.scard .top2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.scard .no {
  background: var(--night);
  color: #fff;
  border-radius: 12px;
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: var(--f-disp);
  font-weight: 800;
}

.scard b {
  font-family: var(--f-disp);
  font-size: 1.12rem;
  line-height: 1.1;
}

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

.ctrl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.seg {
  display: inline-flex;
  border: 2px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.seg button {
  padding: 7px 12px;
  font-weight: 800;
  font-size: .88rem;
  color: var(--muted);
}

.seg button.on {
  background: var(--night);
  color: #fff;
}

.ayat {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 6px;
  transition: border-color .2s,background .2s;
}

.ayat.now {
  border-color: var(--sun);
  background: #FFFBEA;
  box-shadow: 0 0 0 4px rgba(255,201,60,.35);
}

.ayat.mem {
  border-color: #9ADFCD;
}

.ayat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ayat-top .no {
  white-space: nowrap;
  background: var(--night);
  color: #fff;
  border-radius: 99px;
  padding: 1px 12px;
  font-family: var(--f-disp);
  font-weight: 700;
  font-size: .85rem;
}

.ayat .tr {
  color: #3E5A57;
  font-size: .92rem;
  font-weight: 600;
  text-align: center;
}

.ayat.cover .cov {
  filter: blur(10px);
  cursor: pointer;
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: .85rem;
  padding: 5px 12px;
  border-radius: 99px;
  border: 2px solid var(--line);
  background: #fff;
}

.tick.on {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: #0B5C40;
}

/* badges, profile */

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

.badge {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 14px 10px;
  text-align: center;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.badge .e {
  font-size: 2.4rem;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #FFF4CC;
  border: 3px solid var(--sun);
}

.badge.lock {
  opacity: .6;
}

.badge.lock .e {
  filter: grayscale(1);
  background: #EAF0EC;
  border-color: var(--line);
}

.badge b {
  font-family: var(--f-disp);
  font-size: 1rem;
  line-height: 1.1;
}

.badge small {
  color: var(--muted);
  font-weight: 700;
  font-size: .76rem;
  line-height: 1.25;
}

.field {
  display: grid;
  gap: 6px;
}

.field input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  font: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--night);
}

.ring {
  --p: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: conic-gradient(var(--mint) calc(var(--p)*1%),var(--line) 0);
  display: grid;
  place-items: center;
  flex: none;
}

.ring>div {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-family: var(--f-disp);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--night);
  text-align: center;
  line-height: 1;
}

.ring small {
  display: block;
  font-size: .65rem;
  color: var(--muted);
  font-family: var(--f-ui);
  font-weight: 800;
  margin-top: 2px;
}

.row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

/* bottom nav */

.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: #fff;
  border-top: 3px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom,0px));
}

.bottom .in {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 4px;
}

.tab {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 6px 4px;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 800;
  font-size: .72rem;
}

.tab span {
  font-size: 1.5rem;
  line-height: 1.3;
  filter: grayscale(.7);
}

.tab.on {
  background: #E3F2EA;
  color: var(--night);
}

.tab.on span {
  filter: none;
}

body.in-game .bottom {
  display: none;
}

.toast-box {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom,0px));
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(92vw,420px);
  pointer-events: none;
}

.toast {
  background: var(--night);
  color: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: up .25s ease-out;
  display: flex;
  gap: 10px;
  align-items: center;
}

.toast.gold {
  background: linear-gradient(90deg,#B77900,#E8A200);
}

/* certificate */

.cert-wrap {
  max-width: 720px;
}

.cert {
  background: #fff;
  border: 10px double #E9C76B;
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  display: grid;
  gap: 8px;
  position: relative;
}

.cert h3 {
  font-size: 1.8rem;
  color: var(--night);
}

.cert .nm {
  font-family: var(--f-disp);
  font-weight: 800;
  font-size: 2rem;
  color: var(--mint-d);
  border-bottom: 3px solid var(--sun);
  display: inline-block;
  padding: 0 18px;
  justify-self: center;
}

.cert .ar {
  font-size: 1.7rem;
}
