:root{
  --blue:#1976d2;
  --blue2:#0f5fb8;
  --yellow:#ffd400;
  --bg:#f3f5f7;
  --text:#111827;
  --muted:#6b7280;
  --red:#ef4444;
  --card:#ffffff;
  --shadow:0 10px 25px rgba(0,0,0,.12);
  --shadow2:0 6px 18px rgba(0,0,0,.18);
}

*{ box-sizing:border-box; }
html,body{
  margin:0;
  font-family:'Noto Sans Myanmar', sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* HEADER */
.header{
  position:sticky;
  top:0;
  z-index:10;
  height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 12px;
  background:linear-gradient(180deg,var(--blue),var(--blue2));
  color:#fff;
}
.header-title{ font-weight:700; letter-spacing:.5px; }

.icon-btn{
  border:none;
  background:transparent;
  color:#fff;
  width:44px;
  height:44px;
  border-radius:12px;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.icon-btn:active{ transform:translateY(1px); opacity:.9; }

/* YELLOW BAR */
.yellow-bar{
  background:var(--yellow);
  padding:10px 14px;
  border-bottom:3px solid #eab308;
}
.yellow-title{
  text-align:center;
  font-weight:700;
  color:#111;
}

/* MAIN */
.wrap{ padding:14px; max-width:560px; margin:0 auto; }
.hint{
  background:#fff;
  border-radius:14px;
  padding:12px 14px;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
  font-size:14px;
}

.row{ display:flex; gap:12px; margin-top:12px; }
.row2{ align-items:center; justify-content:space-between; }

.btn{
  border:none;
  cursor:pointer;
  border-radius:14px;
  font-weight:700;
  letter-spacing:.2px;
  box-shadow:0 8px 18px rgba(0,0,0,.12);
  transition:transform .08s ease, box-shadow .2s ease, filter .2s ease;
}

/* PRESS (ကျွံဝင်) */
.btn:active{
  transform:translateY(2px) scale(.98);
  box-shadow:0 4px 10px rgba(0,0,0,.18);
}

.btn-r{
  width:72px;
  background:linear-gradient(180deg,#ffe27a,#ffc107);
  color:#1f2937;
  font-size:18px;
}
.btn-r.active{
  background:linear-gradient(180deg,#ff5a5a,#ef4444);
  color:#fff;
}

.btn-play{
  flex:1;
  background:linear-gradient(180deg,#ff5a5a,#ef4444);
  color:#fff;
  font-size:16px;
}

.mini-btn{
  border:none;
  background:#fff;
  color:#ef4444;
  font-weight:700;
  padding:10px 12px;
  border-radius:12px;
  box-shadow:0 6px 14px rgba(0,0,0,.08);
  cursor:pointer;
}
.mini-btn:active{ transform:translateY(1px); }

.mini-info{ color:var(--muted); font-size:13px; }

/* GRID */
.grid{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:12px;
}

.cell{
  background:var(--card);
  border-radius:14px;
  box-shadow:0 8px 16px rgba(0,0,0,.08);
  padding:16px 0;
  text-align:center;
  position:relative;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .18s ease;
}

/* press effect for numbers */
.cell:active{
  transform:translateY(2px) scale(.98);
  box-shadow:0 5px 12px rgba(0,0,0,.12);
}

/* 85 badge */
.badge85{
  position:absolute;
  top:-8px;
  left:-8px;
  width:30px;
  height:30px;
  border-radius:999px;
  background:linear-gradient(180deg,#ff4d4d,#e11d48);
  color:#fff;
  font-size:12px;
  font-weight:800;
  display:grid;
  place-items:center;
  box-shadow:0 8px 14px rgba(225,29,72,.35);
}

.num{
  font-size:22px;
  font-weight:800;
  color:#111;
  letter-spacing:.8px;
}

/* highlight blue */
.cell.selected{
  outline:3px solid #1d4ed8;
  box-shadow:0 10px 22px rgba(29,78,216,.25);
}

/* R selected style */
.cell.r-selected{
  outline:3px solid #ef4444;
  box-shadow:0 10px 22px rgba(239,68,68,.22);
}
.cell.r-selected .num::after{
  content:" R";
  font-size:12px;
  font-weight:900;
  color:#ef4444;
}

/* MODAL BASE */
.modal, .page{
  position:fixed;
  inset:0;
  display:none;
  z-index:50;
}
.modal.show, .page.show{ display:flex; }

.modal{
  background:rgba(0,0,0,.45);
  align-items:flex-end;
  justify-content:center;
  padding:12px;
}

/* AMOUNT SHEET */
.sheet{
  width:min(560px, 100%);
  background:#fff;
  border-radius:18px;
  box-shadow:var(--shadow2);
  padding:14px;
  animation:popUp .18s ease;
}
@keyframes popUp{
  from{ transform:translateY(20px); opacity:.7; }
  to{ transform:translateY(0); opacity:1; }
}
.sheet-head{ padding:6px 4px 10px; }
.sheet-title{ font-weight:800; }

.amount-row{ margin-top:10px; }
select, input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  font-size:16px; /* iOS zoom fix */
  outline:none;
}
.sheet-actions{
  display:flex;
  gap:10px;
  margin-top:12px;
}
.btn-ghost{
  flex:1;
  background:#f3f4f6;
  color:#111;
  box-shadow:none;
  font-weight:800;
}
.btn-danger{
  flex:1;
  background:linear-gradient(180deg,#ff5a5a,#ef4444);
  color:#fff;
}

.btn-full{ width:100%; padding:14px; border-radius:14px; }

/* SLIP PAGE */
.page{
  background:rgba(0,0,0,.45);
  align-items:center;
  justify-content:center;
  padding:12px;
}
.slip{
  width:min(560px,100%);
  background:#fff;
  border-radius:18px;
  box-shadow:var(--shadow2);
  padding:14px;
  animation:popUp .18s ease;
}
.slip-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.slip-title{ font-weight:900; color:#111; }
.slip-total{
  margin-top:10px;
  padding:12px;
  border-radius:14px;
  background:#f8fafc;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.total-mmks{ font-weight:900; color:#111; }

.slip-list{
  margin-top:10px;
  max-height:45vh;
  overflow:auto;
  border-radius:14px;
  border:1px solid #eef2f7;
}
.slip-item{
  display:flex;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid #eef2f7;
  font-weight:800;
}
.slip-item:last-child{ border-bottom:none; }
.slip-left{ color:#111; }
.slip-right{ color:#ef4444; }

/* NOTI */
.noti{
  width:min(520px,100%);
  background:#fff;
  border-radius:18px;
  box-shadow:var(--shadow2);
  padding:14px;
  animation:popUp .18s ease;
}
.noti-title{ font-weight:900; color:#111; }
.noti-text{ margin:10px 0 12px; color:#111; }

/* RULES */
.rules{
  width:min(560px,100%);
  background:#fff;
  border-radius:18px;
  box-shadow:var(--shadow2);
  padding:14px;
  animation:popUp .18s ease;
}
.rules-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.rules-title{ font-weight:900; color:#111; }
.rules-body{
  margin-top:10px;
  max-height:55vh;
  overflow:auto;
  border-radius:14px;
  border:1px solid #eef2f7;
  padding:12px;
  color:#111;
}
.rules-big{ font-weight:900; margin-bottom:8px; }
.rules-ul{ margin:0; padding-left:18px; }
.rules-ul li{ margin:8px 0; line-height:1.5; }

.rules .icon-btn{ color:#111; background:#f3f4f6; }
.rules .icon-btn:active{ transform:translateY(1px); }