/* ==========================================================================
   Khu vực Game — bảng màu tối, chỉ nạp ở /game/ và các trang con của game
   ========================================================================== */

.game-page {
  --deep: #0b1420;
  --deep2: #111e2e;
  --neon: #45e0c8;
  background: var(--deep);
  color: var(--paper);
}

.game-page .grain {
  opacity: .1;
}

/* Header tối ------------------------------------------------------------ */

.site-header.is-dark {
  background: rgba(11, 20, 32, .9);
  border-bottom-color: rgba(244, 239, 227, .12);
}

.site-header.is-dark .brand,
.site-header.is-dark .main-nav .nav-link,
.site-header.is-dark .nav-drop-btn,
.site-header.is-dark .coin-wallet {
  color: var(--paper);
}

.site-header.is-dark .brand-mark {
  background: var(--paper);
}

.site-header.is-dark .brand-mark svg {
  stroke: var(--ink);
}

.site-header.is-dark .coin-wallet {
  background: rgba(244, 239, 227, .07);
  border-color: rgba(244, 239, 227, .22);
}

.site-header.is-dark .main-nav .nav-cta {
  background: var(--neon);
  color: var(--deep);
}

.site-header.is-dark .main-nav .nav-login {
  border-left-color: rgba(244, 239, 227, .2);
}

.site-header.is-dark .nav-cta span {
  color: var(--deep);
}

.site-header.is-dark .menu-toggle {
  background: rgba(244, 239, 227, .07);
  border-color: rgba(244, 239, 227, .22);
}

.site-header.is-dark .menu-toggle span {
  background: var(--paper);
}

@media (max-width: 980px) {
  .site-header.is-dark + .main-nav,
  .game-page .main-nav {
    background: var(--deep);
  }
  .game-page .main-nav .nav-link,
  .game-page .nav-drop-btn {
    color: var(--paper);
    border-bottom-color: rgba(244, 239, 227, .14);
  }
  .game-page .nav-drop {
    border-bottom-color: rgba(244, 239, 227, .14);
  }
  .game-page .drop-panel {
    background: var(--deep2);
  }
  .game-page .drop-col-head,
  .game-page .drop-list a {
    color: var(--paper);
  }
  .game-page .drop-list a:hover {
    background: rgba(244, 239, 227, .07);
  }
}

/* Sảnh game ------------------------------------------------------------- */

.arcade-hero {
  position: relative;
  padding: 82px clamp(24px, 5vw, 86px) 72px;
  overflow: hidden;
}

.arcade-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 420px at 68% 8%, rgba(69, 224, 200, .16), transparent 68%),
    radial-gradient(560px 380px at 8% 92%, rgba(181, 67, 56, .18), transparent 70%);
}

.arcade-hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(69, 224, 200, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 224, 200, .07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, #000, transparent 88%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 88%);
}

.arcade-hero > * {
  position: relative;
}

.arcade-hero .eyebrow {
  color: var(--neon);
}

.arcade-hero .eyebrow span {
  background: var(--neon);
}

.arcade-hero h1 {
  font: clamp(42px, 6vw, 84px)/.98 "Special Elite", serif;
  letter-spacing: -2px;
  margin: 18px 0 0;
  text-shadow: 0 0 34px rgba(69, 224, 200, .3);
}

.arcade-hero h1 mark {
  background: none;
  color: var(--neon);
}

.arcade-hero .lede {
  max-width: 58ch;
  margin: 22px 0 0;
  font-size: 16.5px;
  line-height: 1.85;
  color: rgba(244, 239, 227, .68);
}

.arcade-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0 34px;
  margin-top: 40px;
}

.arcade-stats div {
  padding: 0 26px;
  border-left: 1px solid rgba(244, 239, 227, .16);
}

.arcade-stats div:first-child {
  padding-left: 0;
  border: 0;
}

.arcade-stats strong {
  display: block;
  font: 28px/1 "Special Elite", serif;
  color: var(--neon);
}

.arcade-stats span {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(244, 239, 227, .5);
  margin-top: 8px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--deep2);
  border: 1px solid rgba(244, 239, 227, .14);
  text-decoration: none;
  color: var(--paper);
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--neon);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(69, 224, 200, .25);
}

.game-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(69, 224, 200, .2), transparent 62%), #0a1119;
  overflow: hidden;
}

.game-cover svg {
  width: 44%;
  fill: none;
  stroke: var(--neon);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(69, 224, 200, .45));
  transition: transform .45s;
}

.game-card:hover .game-cover svg {
  transform: scale(1.09);
}

.game-cover:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
  opacity: .55;
  pointer-events: none;
}

.game-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font: 700 10.5px/1 "Be Vietnam Pro", sans-serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 6px 11px;
  background: rgba(69, 224, 200, .16);
  color: var(--neon);
  border: 1px solid rgba(69, 224, 200, .4);
}

.game-body {
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-body h3 {
  font: 25px/1.2 "Special Elite", serif;
  margin: 0 0 12px;
  letter-spacing: -.4px;
}

.game-card:hover h3 {
  color: var(--neon);
}

.game-body p {
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(244, 239, 227, .62);
  margin: 0 0 22px;
}

.game-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: rgba(244, 239, 227, .45);
  margin-bottom: 22px;
}

.game-stat-row b {
  color: var(--neon);
  font-family: "Special Elite", serif;
  font-size: 13.5px;
  letter-spacing: 0;
  margin-right: 5px;
}

.play-btn {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--neon);
  color: var(--deep);
  padding: 13px 22px;
  font: 800 13.5px/1 "Be Vietnam Pro", sans-serif;
  letter-spacing: .6px;
  transition: .2s;
}

.game-card:hover .play-btn {
  box-shadow: 0 0 22px rgba(69, 224, 200, .55);
}

.play-btn:before {
  content: "\25B6";
  font-size: 11px;
}

.best-score {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  font: 11px/1 "Special Elite", serif;
  letter-spacing: 1.2px;
  color: var(--gold);
  background: rgba(11, 20, 32, .78);
  border: 1px solid rgba(231, 183, 75, .4);
  padding: 6px 10px;
}

/* Màn chơi -------------------------------------------------------------- */

.stage-wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 40px) 80px;
}

.game-stage {
  position: relative;
  background: var(--deep2);
  border: 1px solid rgba(69, 224, 200, .26);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 30px 70px rgba(0, 0, 0, .55);
}

.game-stage:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px);
  pointer-events: none;
  z-index: 5;
}


/* Bốc Sỏi ---------------------------------------------------------------- */

.pb-wrap { max-width: 1240px; }

.pb-title {
  font: clamp(32px, 4.4vw, 56px)/1 "Special Elite", serif;
  letter-spacing: -1.2px;
  margin: 16px 0 30px;
}

.pb-game {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 260px;
  gap: 26px;
  align-items: start;
}

/* Nhân vật và bong bóng thoại */
.pb-cast { display: grid; gap: 22px; }

.pb-char {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: start;
}

.pb-char img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  object-position: 50% 8%;
  border-radius: 50%;
  border: 3px solid var(--neon);
  background: var(--paper);
}

.pb-speech {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 13px 12px;
  border-radius: 4px;
  min-height: 74px;
}

.pb-speech:before {
  content: "";
  position: absolute;
  left: -8px;
  top: 22px;
  border: 8px solid transparent;
  border-left: 0;
  border-right-color: var(--paper);
}

.pb-speech b {
  display: block;
  font: 800 11px/1 "Be Vietnam Pro", sans-serif;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.pb-bubble {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.pb-char.is-talking .pb-speech { animation: pb-pop .35s ease; }
.pb-char.is-talking img { animation: pb-nod .45s ease; }

@keyframes pb-pop {
  from { transform: scale(.94); opacity: .4; }
}

@keyframes pb-nod {
  40% { transform: translateY(-5px) rotate(-4deg); }
}

/* Sân chơi */
.pb-stage { min-height: 520px; }

.pb-setup {
  min-height: 520px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 40px 24px;
}

.pb-levels {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 30px;
}

.pb-levels button {
  position: relative;
  z-index: 6;
  flex: 1 1 0;
  min-width: 96px;
  padding: 11px 8px 12px;
  border: 1px solid rgba(244, 239, 227, .25);
  background: transparent;
  color: var(--paper);
  font: 800 15px/1.2 "Be Vietnam Pro", sans-serif;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.pb-levels button small {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(244, 239, 227, .55);
}

.pb-levels button:hover:not(:disabled) { border-color: var(--neon); }

.pb-levels button.is-active {
  background: rgba(69, 224, 200, .14);
  border-color: var(--neon);
  color: var(--neon);
}

.pb-levels button.is-locked {
  opacity: .45;
  cursor: not-allowed;
}

.pb-levels button.is-locked:before {
  content: "\1F512";
  margin-right: 6px;
  font-size: 12px;
}

/* Hình minh hoạ cách xếp sỏi trước khi bắt đầu */
.pb-preview {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
  max-width: 380px;
}

.pb-preview-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 3px;
  width: 100%;
}

.pb-preview-row img {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}

.pb-preview.is-row .pb-preview-row img { width: 22px; height: 22px; }

.pb-preview-row span {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font: 700 10.5px/1 "Be Vietnam Pro", sans-serif;
  color: rgba(244, 239, 227, .45);
}

.pb-setup-art {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5));
  animation: pb-bob 3s ease-in-out infinite;
}

@keyframes pb-bob {
  50% { transform: translateY(-8px) rotate(6deg); }
}

.pb-setup h2 {
  font: 30px/1.2 "Special Elite", serif;
  margin: 22px 0 8px;
}

.pb-setup p {
  margin: 0 0 28px;
  color: rgba(244, 239, 227, .6);
}

.pb-count-line { font-size: 17px; }

.pb-count {
  font: 34px/1 "Special Elite", serif;
  color: var(--gold);
  margin: 0 4px;
  vertical-align: -3px;
}

.pb-setup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.pb-btn {
  position: relative;
  z-index: 6;
  border: 0;
  background: var(--neon);
  color: var(--deep);
  padding: 14px 24px;
  font: 800 14px/1 "Be Vietnam Pro", sans-serif;
  letter-spacing: .4px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}

.pb-btn:hover:not(:disabled) { box-shadow: 0 0 22px rgba(69, 224, 200, .55); }
.pb-btn:active:not(:disabled) { transform: translateY(2px); }

.pb-btn.ghost {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(244, 239, 227, .4);
}

.pb-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Hiraku "bấm" nút Lấy sỏi */
.pb-btn.is-bot-press {
  opacity: 1;
  background: var(--gold);
  transform: translateY(2px);
  box-shadow: 0 0 22px rgba(231, 183, 75, .6);
}

.pb-board { position: relative; padding: 22px 22px 24px; }

.pb-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(244, 239, 227, .12);
}

.pb-tray span,
.pb-center span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(244, 239, 227, .5);
}

.pb-tray b {
  font: 30px/1.2 "Special Elite", serif;
  color: var(--paper);
}

.pb-bot { text-align: right; }
.pb-you b { color: var(--gold); }
.pb-bot b { color: var(--neon); }

.pb-center { text-align: center; }

.pb-center b {
  display: block;
  font: 54px/1 "Special Elite", serif;
  color: var(--paper);
  margin: 4px 0;
}

.pb-turn {
  display: inline-block;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border: 1px solid rgba(244, 239, 227, .25);
}

.pb-turn.is-you { color: var(--deep); background: var(--gold); border-color: var(--gold); }
.pb-turn.is-bot { color: var(--deep); background: var(--neon); border-color: var(--neon); }

.pb-field {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
  padding: 24px 4px;
  min-height: 300px;
  align-content: start;
}

/* Vòng 4: một hàng sỏi duy nhất, có số thứ tự; viên đã bốc để lại ô trống */
.pb-field.is-row {
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 2px;
  align-content: center;
  min-height: 240px;
  padding: 24px 0;
}

.pb-slot {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.pb-slot .pebble {
  width: 100%;
  padding: 0;
  --s: 1.05;
}

.pb-slot-no {
  font: 700 11px/1 "Be Vietnam Pro", sans-serif;
  color: rgba(244, 239, 227, .55);
}

.pb-slot.is-empty .pb-slot-no { opacity: .3; }

.pb-slot.is-empty:before {
  content: "";
  grid-area: 1 / 1;
  align-self: center;
  width: 46%;
  aspect-ratio: 1;
  border: 1px dashed rgba(244, 239, 227, .18);
  border-radius: 50%;
}

.pb-slot > * { grid-area: auto; }
.pb-slot .pebble { grid-area: 1 / 1; }
.pb-slot .pb-slot-no { grid-area: 2 / 1; }

/* Vòng 7: 7 hàng xếp hình tam giác, chọn sỏi trên cùng một hàng */
.pb-field.is-nim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 0;
}

.pb-nim-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.pb-nim-label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font: 700 11px/1 "Be Vietnam Pro", sans-serif;
  letter-spacing: .6px;
  color: rgba(244, 239, 227, .45);
}

.pb-nim-row .pebble {
  width: 48px;
  padding: 2px;
}

.pebble.is-other-row:not(.is-gone) { opacity: .3; }

@media (max-width: 640px) {
  .pb-nim-row .pebble { width: 40px; }
  .pb-nim-label { font-size: 10px; }
}

.pebble {
  position: relative;
  z-index: 6;
  aspect-ratio: 1;
  border: 0;
  padding: 4px;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  transform: rotate(var(--r)) scale(var(--s));
  transition: transform .2s, filter .2s, opacity .2s;
  animation: pb-drop .45s backwards;
  animation-delay: var(--d);
}

.pebble img {
  display: block;
  width: 100%;
  height: 100%;
  filter: hue-rotate(var(--tone)) sepia(.25) drop-shadow(0 6px 6px rgba(0, 0, 0, .55));
  pointer-events: none;
}

.pebble:hover { transform: rotate(var(--r)) scale(calc(var(--s) + .08)); }

.pebble.is-picked {
  transform: translateY(-8px) rotate(var(--r)) scale(calc(var(--s) + .1));
  filter: drop-shadow(0 0 10px rgba(231, 183, 75, .95));
}

.pebble.is-picked:after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px dashed var(--gold);
  border-radius: 50%;
}

.pebble.by-bot { filter: drop-shadow(0 0 10px rgba(69, 224, 200, .95)); }
.pebble.by-bot:after { border-color: var(--neon); }

.pb-field.is-full .pebble:not(.is-picked):not(.is-gone),
.pb-field.is-locked .pebble:not(.is-picked):not(.is-gone) {
  opacity: .55;
  cursor: default;
}

.pb-field.is-locked .pebble:hover:not(.is-picked) { transform: rotate(var(--r)) scale(var(--s)); }

.pebble.is-gone {
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s .6s;
  animation: pb-fly .6s ease-in forwards;
}

@keyframes pb-drop {
  from { opacity: 0; transform: translateY(-30px) rotate(var(--r)) scale(var(--s)); }
}

@keyframes pb-fly {
  to { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.3); }
}

.pb-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 239, 227, .12);
}

.pb-picked {
  font-size: 14px;
  font-weight: 600;
  color: rgba(244, 239, 227, .7);
}

.pb-result {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 24px;
  background: rgba(11, 20, 32, .9);
  animation: pb-pop .4s ease;
}

.pb-setup[hidden],
.pb-board[hidden],
.pb-result[hidden] { display: none; }

.pb-result h2 {
  font: clamp(38px, 5vw, 60px)/1 "Special Elite", serif;
  color: var(--neon);
  margin: 0 0 14px;
}

.pb-result.is-win h2 { color: var(--gold); }

.pb-result p {
  max-width: 40ch;
  margin: 0 0 26px;
  line-height: 1.7;
  color: rgba(244, 239, 227, .75);
}

/* Cột phải */
.pb-side { display: grid; gap: 20px; }

.pb-side .aside-card {
  background: rgba(244, 239, 227, .05);
  border-color: rgba(244, 239, 227, .16);
  color: var(--paper);
}

.pb-side .aside-card h4 {
  color: rgba(244, 239, 227, .5);
  border-bottom-color: rgba(244, 239, 227, .16);
}

.pb-rules ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(244, 239, 227, .78);
}

.pb-rules li + li { border: 0; padding-top: 4px; margin-top: 0; }

.pb-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 13.5px;
}

.pb-log li {
  padding: 7px 0 7px 12px;
  border-left: 3px solid rgba(244, 239, 227, .2);
  color: rgba(244, 239, 227, .8);
}

.pb-log li + li { margin-top: 6px; }
.pb-log li.you { border-left-color: var(--gold); }
.pb-log li.bot { border-left-color: var(--neon); }
.pb-log li.sys { color: rgba(244, 239, 227, .5); }

.pb-credit {
  margin-top: 22px;
  font-size: 12px;
  color: rgba(244, 239, 227, .38);
}

@media (max-width: 1080px) {
  .pb-game { grid-template-columns: 1fr; }
  .pb-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .pb-side { grid-template-columns: 1fr; }
  .pb-board { padding: 16px 12px 18px; }
  .pb-field { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; padding: 18px 0; }
  .pb-center b { font-size: 42px; }
  .pb-tray b { font-size: 24px; }
  .pb-controls { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Card game nằm ngang (khi sảnh chỉ có một game) */
.game-grid.single,
.game-strip.single { grid-template-columns: 1fr; }

.game-card.wide { flex-direction: row; }
.game-card.wide .game-cover { flex: 0 0 46%; aspect-ratio: auto; min-height: 280px; }
.game-card.wide .game-body { justify-content: center; }

.pb-cover img {
  position: absolute;
  width: 22%;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .6));
  transition: transform .45s;
}

.pb-cover img:nth-of-type(1) { left: 18%; top: 22%; transform: rotate(-20deg); }
.pb-cover img:nth-of-type(2) { left: 40%; top: 14%; width: 26%; transform: rotate(35deg); }
.pb-cover img:nth-of-type(3) { left: 62%; top: 30%; width: 18%; transform: rotate(80deg); }
.pb-cover img:nth-of-type(4) { left: 28%; top: 52%; width: 20%; transform: rotate(150deg); }
.pb-cover img:nth-of-type(5) { left: 52%; top: 50%; width: 24%; transform: rotate(-70deg); }
.game-card:hover .pb-cover img { transform: translateY(-6px) rotate(10deg); }

@media (max-width: 760px) {
  .game-card.wide { flex-direction: column; }
  .game-card.wide .game-cover { min-height: 220px; }
}

/* Dải Game trên trang chủ ----------------------------------------------- */

.game-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.game-strip .game-card {
  background: rgba(244, 239, 227, .04);
}

.game-strip .game-body {
  padding: 20px 20px 22px;
}

.game-strip .game-body h3 {
  font-size: 19px;
}

.game-strip .game-body p {
  font-size: 13.5px;
  margin-bottom: 16px;
}

@media (max-width: 1080px) {
  .game-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .game-grid,
  .game-strip { grid-template-columns: 1fr; }
}

/* Game Đọc Suy Nghĩ ------------------------------------------------------ */

.mt-card {
  display: block;
  width: 100%;
  height: auto;
  padding: 3px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}

.mt-intro,
.mt-reveal {
  min-height: 520px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 40px 24px;
}

.mt-intro[hidden],
.mt-ask[hidden],
.mt-reveal[hidden] { display: none; }

.mt-intro h2,
.mt-ask h2,
.mt-reveal h2 {
  font: 30px/1.2 "Special Elite", serif;
  margin: 22px 0 8px;
}

.mt-intro p,
.mt-reveal p {
  max-width: 44ch;
  margin: 0 0 28px;
  line-height: 1.7;
  color: rgba(244, 239, 227, .6);
}

.mt-cover .mt-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 92px;
  margin-left: -46px;
  transform-origin: 50% 130%;
  transition: transform .45s;
}

.mt-cover .mt-card:nth-of-type(1) { transform: rotate(-30deg); }
.mt-cover .mt-card:nth-of-type(2) { transform: rotate(-15deg); }
.mt-cover .mt-card:nth-of-type(4) { transform: rotate(15deg); }
.mt-cover .mt-card:nth-of-type(5) { transform: rotate(30deg); }

.mt-ask { padding: 26px 26px 30px; }

.mt-ask h2 { margin: 4px 0 8px; text-align: center; }

.mt-warn {
  margin: 0 0 20px;
  text-align: center;
  font-size: 14px;
  font-style: italic;
  color: var(--gold);
}

.mt-list {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px 8px;
}

.mt-list li { animation: mt-deal .35s ease backwards; }

@keyframes mt-deal {
  from { opacity: 0; transform: translateY(-10px) scale(.92); }
}

.mt-flip {
  width: 170px;
  aspect-ratio: 222 / 323;
  perspective: 900px;
}

.mt-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}

.mt-flip.is-open .mt-flip-inner { transform: rotateY(180deg); }
.mt-flip.is-thinking .mt-flip-inner { animation: mt-shake .5s ease-in-out infinite; }

@keyframes mt-shake {
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

.mt-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}

.mt-back {
  border: 7px solid #fff;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 22%, rgba(255, 255, 255, .18) 22% 24%, transparent 24%),
    repeating-linear-gradient(45deg, #8f1d1d 0 6px, #b3292a 6px 12px);
}

.mt-front {
  padding: 5px;
  background: #fff;
  transform: rotateY(180deg);
}

.mt-reveal h2 {
  font-size: clamp(34px, 4.6vw, 52px);
  color: var(--gold);
  min-height: 1.2em;
}

.mt-reveal [hidden] { display: none; }

@media (max-width: 640px) {
  .mt-ask { padding: 18px 12px 22px; }
  .mt-list { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 8px 6px; }
  .mt-ask h2 { font-size: 24px; }
}

/* Ảnh bìa Đọc Suy Nghĩ ở sảnh game */
.mt-cover .mt-card { width: 22%; margin-left: -11%; bottom: 14%; }
.game-card:hover .mt-cover .mt-card:nth-of-type(1) { transform: rotate(-38deg); }
.game-card:hover .mt-cover .mt-card:nth-of-type(2) { transform: rotate(-19deg); }
.game-card:hover .mt-cover .mt-card:nth-of-type(4) { transform: rotate(19deg); }
.game-card:hover .mt-cover .mt-card:nth-of-type(5) { transform: rotate(38deg); }

.game-strip.duo { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 760px) {
  .game-strip.duo { grid-template-columns: 1fr; }
}

/* Bài rải lộn xộn trên bàn ở màn mở đầu */
.mt-spread {
  position: relative;
  width: min(100%, 580px);
  height: 250px;
  margin-bottom: 18px;
}

.mt-spread .mt-card,
.mt-down {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 66px;
  transform: translate(-50%, -50%) rotate(var(--r));
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45);
}

.mt-down {
  aspect-ratio: 222 / 323;
  border: 4px solid #fff;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #8f1d1d 0 4px, #b3292a 4px 8px);
}

@media (max-width: 640px) {
  .mt-spread { height: 200px; }
  .mt-spread .mt-card,
  .mt-down { width: 50px; }
}

/* Hai màn xác nhận trước khi hỏi */
.mt-confirm {
  min-height: 520px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 40px 24px;
}

.mt-confirm[hidden] { display: none; }
.mt-confirm.is-in { animation: pb-pop .4s ease; }

.mt-confirm h2 {
  font: clamp(28px, 3.6vw, 38px)/1.25 "Special Elite", serif;
  margin: 30px 0 28px;
  max-width: 18ch;
}

.mt-confirm .pb-btn { min-width: 140px; }

.mt-confirm-card {
  position: static;
  width: 96px;
  transform: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .5);
  animation: pb-bob 2.6s ease-in-out infinite;
}

/* Game Con Mắt Ngàn Năm -------------------------------------------------- */

.cm-glyph {
  font-family: "Noto Sans Egyptian Hieroglyphs", "Segoe UI Historic", "Noto Sans", sans-serif;
  font-style: normal;
  line-height: 1;
}

.cm-panel {
  min-height: 520px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 40px 24px;
}

.cm-panel[hidden],
.cm-panel [hidden] { display: none; }
.cm-panel.is-in { animation: pb-pop .4s ease; }

.cm-panel h2 {
  font: clamp(26px, 3.4vw, 34px)/1.25 "Special Elite", serif;
  margin: 22px 0 8px;
  max-width: 22ch;
}

.cm-panel p {
  max-width: 46ch;
  margin: 0 0 28px;
  line-height: 1.7;
  color: rgba(244, 239, 227, .65);
}

/* Con mắt: khung Mắt Horus phủ trên, con ngươi nằm dưới và chỉ lộ ra trong vùng tròng (mask lo.png) */
.cm-eye {
  position: relative;
  width: 300px;
  aspect-ratio: 1;
  filter: drop-shadow(0 0 22px rgba(231, 183, 75, .35));
  animation: cm-float 4s ease-in-out infinite;
}

.cm-eye-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cm-eye-hole {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 14% 6% at 49.6% 47.2%, #fffbea 0, #f1e2b8 70%, #b9965a 100%);
  -webkit-mask: url(/assets/mat/lo.png) 0 0 / 100% 100% no-repeat;
  mask: url(/assets/mat/lo.png) 0 0 / 100% 100% no-repeat;
}

.cm-eye-iris {
  position: absolute;
  left: 49.6%;
  top: 47.2%;
  width: 13%;
  height: auto;
  margin: -6.5% 0 0 -6.5%;
  animation: cm-look 7s ease-in-out infinite;
}

@keyframes cm-float {
  50% { transform: translateY(-3px); }
}

@keyframes cm-look {
  0%, 20% { transform: translate(0, 0); }
  26%, 42% { transform: translate(-14%, -2%); }
  48%, 64% { transform: translate(13%, 2%); }
  70%, 100% { transform: translate(0, 0); }
}

/* Lúc quét: mắt nhìn thẳng, con ngươi co giãn, cả con mắt phóng to và toả sáng */
.cm-read .cm-eye { width: 340px; transition: transform .8s ease; }
.cm-read.is-reading .cm-eye {
  transform: scale(1.12);
  animation: cm-stare 1.4s ease-in-out infinite;
}
.cm-read.is-reading .cm-eye-iris { animation: cm-pulse 1.1s ease-in-out infinite; }
.cm-read.is-done .cm-eye-iris { animation: none; }
.cm-read.is-done .cm-eye {
  animation: none;
  filter: drop-shadow(0 0 30px rgba(69, 224, 200, .55));
}

@keyframes cm-pulse {
  50% { transform: scale(1.25); filter: brightness(1.35); }
}

@keyframes cm-stare {
  50% { filter: drop-shadow(0 0 48px rgba(255, 210, 90, .9)) brightness(1.12); }
}

.cm-answer {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 6px 0 28px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 183, 75, .2), transparent 70%);
  box-shadow: 0 0 40px rgba(231, 183, 75, .35);
  animation: pb-pop .6s ease;
}

.cm-answer .cm-glyph {
  font-size: 84px;
  color: var(--gold);
}

/* Các bước nhẩm */
.cm-step-num {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  font: 32px/1 "Special Elite", serif;
  color: var(--gold);
}

.cm-panel .pb-btn { min-width: 140px; }

/* Bảng 100 số */
.cm-board-wrap { padding: 26px 10px 30px; }
.cm-board-wrap h2 { margin-top: 0; }
.cm-board-wrap .cm-board-note { margin-bottom: 18px; color: var(--gold); }

.cm-board {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

.cm-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  transform: translateX(calc(var(--off, 0) * 52px));
}

.cm-cell {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 46px;
  padding: 5px 0 7px;
  border: 1px solid rgba(231, 183, 75, .22);
  background: rgba(231, 183, 75, .05);
}

.cm-cell b {
  font: 700 12px/1 "Be Vietnam Pro", sans-serif;
  color: rgba(244, 239, 227, .7);
}

.cm-cell .cm-glyph {
  font-size: 24px;
  color: var(--paper);
}

@media (max-width: 640px) {
  .cm-board-wrap { padding: 20px 6px 24px; }
  .cm-board, .cm-row { gap: 3px; }
  .cm-cell { width: calc((100% - 30px) / 11); padding: 4px 0 5px; }
  .cm-row { transform: translateX(calc(var(--off, 0) * ((100% - 30px) / 11 + 3px))); }
  .cm-cell b { font-size: 10px; }
  .cm-cell .cm-glyph { font-size: 17px; }
  .cm-eye { width: 240px; }
  .cm-read .cm-eye { width: 270px; }
}

/* Ảnh bìa Con Mắt Ngàn Năm ở sảnh game */
.cm-cover .cm-eye { width: 62%; animation: none; transition: transform .45s; }
.game-card:hover .cm-cover .cm-eye { transform: scale(1.06); }

.game-grid.trio { grid-template-columns: repeat(3, 1fr); }
.game-strip.trio { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1080px) {
  .game-grid.trio,
  .game-strip.trio { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .game-grid.trio,
  .game-strip.trio { grid-template-columns: 1fr; }
}

/* Ký tự hiện ra từ từ: mờ, nhoè rồi rõ dần trong vòng tròn */
.cm-answer { animation: cm-ring 1s ease both; }

.cm-answer .cm-glyph { animation: cm-emerge 2.6s ease-in .4s both; }

.cm-read.is-done [data-again] { animation: cm-ring .6s ease 2.8s both; }

@keyframes cm-ring {
  from { opacity: 0; transform: scale(.85); }
}

@keyframes cm-emerge {
  0% { opacity: 0; filter: blur(14px); transform: scale(.7); }
  60% { opacity: .6; filter: blur(4px); }
  100% { opacity: 1; filter: blur(0) drop-shadow(0 0 12px rgba(231, 183, 75, .7)); transform: scale(1); }
}

/* Khối chia sẻ cuối game ảo thuật */
.game-share {
  width: min(100%, 440px);
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed rgba(244, 239, 227, .2);
  text-align: center;
}

.game-share[hidden] { display: none; }

.game-share .game-secret {
  max-width: none;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--paper);
}

.game-secret a { color: var(--gold); font-weight: 700; }
.game-secret a:hover { color: var(--neon); }

.game-share .game-share-label {
  margin: 0 0 10px;
  font: 700 11px/1 "Be Vietnam Pro", sans-serif;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(244, 239, 227, .5);
}

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

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(244, 239, 227, .4);
  color: var(--paper);
  font: 700 13px/1 "Be Vietnam Pro", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .2s, background .2s;
}

.share-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.share-btn.is-fb { background: #1877f2; box-shadow: none; color: #fff; }
.share-btn.is-fb svg { fill: currentColor; stroke: none; }
.share-btn:hover { box-shadow: inset 0 0 0 1px var(--neon); }
.share-btn.is-fb:hover { background: #2d86ff; }
.share-btn.is-done { color: var(--neon); box-shadow: inset 0 0 0 1px var(--neon); }

.cm-read.is-done .game-share { animation: cm-ring .6s ease 3s both; }

/* Game không có cột luật chơi bên phải */
.pb-game.no-side { grid-template-columns: 230px minmax(0, 760px); }

@media (max-width: 1080px) {
  .pb-game.no-side { grid-template-columns: 1fr; }
}
