/* Trang Chơi Ngay - dùng chung watch.css, thêm phím điện thoại */

.icon-btn { cursor: pointer; background: transparent; font-family: var(--font); }
.icon-btn:hover { border-color: var(--fire); color: var(--fire-2); }

/* ---------------------------------------------------------------- bàn phím ảo (điện thoại) */
.pad {
  display: none;
  width: min(100%, 480px);
  margin: 14px auto 0;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.pad button {
  border: 3px solid var(--wood);
  border-radius: 14px;
  color: var(--parchment);
  background: var(--bg-2);
  box-shadow: 0 4px 0 var(--wood-dark);
  font-weight: 800;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.pad button.on, .pad button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--wood-dark);
  color: var(--ink);
  background: var(--fire-2);
}
.pad-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  margin-bottom: calc(var(--u, 66px) * .2);
}
/* phím mềm: 2 góc trên, như điện thoại thật */
.soft {
  width: calc(var(--u, 66px) * .97);
  height: calc(var(--u, 66px) * .7);
  display: flex; align-items: center; justify-content: center;
}
.soft-l { justify-self: start; }
.soft-r { justify-self: end; }
.burger, .burger::before, .burger::after {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -8px; }
.burger::after { top: 8px; }
.play .dpad {
  grid-area: auto;
  display: grid;
  grid-template-columns: repeat(3, var(--u, 66px));
  grid-template-rows: repeat(3, var(--u, 66px));
  grid-template-areas: ". up ." "left ok right" ". down .";
  gap: calc(var(--u, 66px) * .09);
  justify-content: center;
}
.play .dpad button { font-size: 1.45rem; border-radius: 14px; }
.dpad .ok { grid-area: ok; font-size: 1.1rem; color: #2d1a08; background: linear-gradient(180deg, var(--fire-2), var(--fire)); }

.t9 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.t9 button {
  height: calc(var(--u, 66px) * .76);
  font-size: 1.25rem;
  line-height: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}

/* ---------------------------------------------------------------- hướng dẫn phím (máy tính) */
.keys-guide {
  width: min(100%, 960px);
  margin: 18px auto 0;
  padding: 14px 18px;
  color: var(--parchment-2);
  border: 2px solid rgba(122, 75, 34, .6);
  border-radius: 12px;
  background: rgba(59, 38, 20, .5);
}
.keys-guide h2 { margin: 0 0 8px; font-size: 1.05rem; color: var(--fire-2); }
.kg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; font-size: .92rem; }
.kg-grid span { margin-left: 8px; }
.soft-note { margin: 10px 0 0; font-size: .82rem; opacity: .8; }

/* ---------------------------------------------------------------- hộp nhập chữ */
.modal {
  position: fixed; inset: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(20, 12, 5, .7);
}
.modal[hidden] { display: none; }
.modal .card { width: min(100%, 340px); }
.modal input {
  width: 100%;
  margin: 8px 0 2px;
  padding: 8px 10px;
  border: 2px solid var(--wood);
  border-radius: 8px;
  font: 700 1.1rem var(--font);
  color: var(--ink);
  background: #fffaf0;
}

/* màn hình đầy đủ: chỉ còn màn chơi + phím */

/* điện thoại / máy tính bảng cảm ứng */
@media (hover: none) and (pointer: coarse), (max-width: 700px) {
  .pad { display: block; margin-top: 10px; }
  .keys-guide { display: none; }
  .main { padding-bottom: 8px; }
  /* đầu trang gọn 1 dòng để dành chỗ cho màn chơi và bàn phím */
  .play .top { grid-template-columns: auto 1fr auto; padding: 6px 12px; }
  .play .top .title small { display: none; }
  .play .top .vs { font-size: 1rem; }
  .play .top::after { content: ""; width: 1.3rem; }
  .play .back span { display: none; }
  .play .back { font-size: 1.3rem; }
  .t9 { gap: calc(var(--u, 66px) * .1); }
}
/* toàn màn hình: chỉ còn màn chơi và bàn phím */
.play:fullscreen .top, :fullscreen .play .top { display: none; }
:fullscreen .play .main { padding-top: 8px; }
