/* Chinese mini-games — matches site cream / rust theme */
.games-hero {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 360px at 10% -20%, #fff 0%, transparent 55%),
    linear-gradient(180deg, #f7f4ec 0%, var(--paper) 100%);
}
.games-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}
.games-hero .lead {
  max-width: 36rem;
  color: var(--ink-soft);
  margin: 0;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0 3rem;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.35rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, #fff 0%, var(--paper-2) 100%);
  transition: border-color 0.15s, transform 0.15s;
}
.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--ink);
}
.game-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
}
.game-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.game-card .tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gomoku-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.5rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}
@media (max-width: 900px) {
  .gomoku-layout {
    grid-template-columns: 1fr;
  }
}

.gomoku-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1rem 1.1rem;
}
.gomoku-side .ad-slot {
  margin-top: 1rem;
}
.gomoku-layout .ad-slot--games-gomoku-below-board {
  margin-top: 1.15rem;
}
.gomoku-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.gomoku-toolbar .diff-group,
.lb-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.diff-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.diff-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gomoku-status {
  font-weight: 600;
  margin: 0 0 0.75rem;
  min-height: 1.4em;
}
.gomoku-board-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
#gomoku-board {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(60, 40, 10, 0.12);
}

.gomoku-side h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.65rem;
}
.gomoku-meta {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.gomoku-meta strong {
  color: var(--ink);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.lb-table th,
.lb-table td {
  text-align: left;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.lb-table th {
  color: var(--ink-soft);
  font-weight: 600;
}

.games-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(26, 26, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.games-overlay[hidden] {
  display: none !important;
}
.games-dialog {
  width: min(100%, 380px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.35rem 1.4rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.games-dialog h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}
.games-dialog p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.games-dialog label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.games-dialog input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  margin-bottom: 0.85rem;
  background: #fff;
}
.games-dialog-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-games {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.5rem 0.95rem;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}
.btn-games:hover {
  background: var(--accent-ink);
}
.btn-games-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.5rem 0.95rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}
.btn-games:disabled,
.btn-games-ghost:disabled,
.diff-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Paijiu */
.pj-meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.pj-meter strong {
  color: var(--accent-ink);
}
.pj-table {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 220px at 50% 0%, #fff8e8 0%, transparent 60%),
    linear-gradient(165deg, #f3ebe0 0%, var(--paper) 100%);
}
.pj-seat-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.pj-hand-block {
  margin-bottom: 0.65rem;
}
.pj-hand-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.pj-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 4.5rem;
}
.pj-tile {
  position: relative;
  width: 3.1rem;
  height: 4.6rem;
  padding: 0;
  border: 1px solid #c4b49a;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdf8 0%, #f4ead8 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font: inherit;
  color: inherit;
}
.pj-tile:disabled {
  cursor: default;
}
.pj-tile.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pj-tile.is-back {
  background: linear-gradient(160deg, #8b3a2a 0%, #5c2418 100%);
  border-color: #4a1c14;
  align-items: center;
  justify-content: center;
}
.pj-tile-back {
  color: #f0d9a8;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}
.pj-half {
  position: relative;
  flex: 1;
  border-bottom: 1px solid #dcc9a8;
}
.pj-half:last-of-type {
  border-bottom: 0;
}
.pj-dot {
  position: absolute;
  width: 0.42rem;
  height: 0.42rem;
  margin: -0.21rem 0 0 -0.21rem;
  border-radius: 50%;
  background: #2a2118;
}
.pj-tile.is-warm .pj-dot {
  background: #b33a2b;
}
.pj-tile-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.15rem;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--ink-soft);
  pointer-events: none;
  line-height: 1;
}
.pj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
}
.pj-hint {
  margin: 0.5rem 0 0;
  max-width: 36rem;
}
.ad-slot--games-paijiu-side .ad-slot__reserve {
  min-height: 200px;
}
