/* Arcade game skins */
:root {
  --ch-bg: #1a1b20;
  --ch-panel: #23242b;
  --ch-line: #32333b;
  --ch-text: #e8e9ef;
  --ch-muted: #9aa0b0;
  --ch-accent: #ff8a2b;
  --ch-red: #c9033a;
  --ch-green: #1db954;
  --ch-blue: #3b82f6;
  --ch-gray: #6b7280;
}

.ch-shell {
  background: var(--ch-bg) url("../images/games/content-bg.png") center top / cover no-repeat;
  border-radius: 20px;
  padding: 18px;
  color: var(--ch-text);
  border: 1px solid var(--ch-line);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.ch-shell .c-result { color: inherit; }
.ch-shell .c-result.win { color: #3dd68c; }
.ch-shell .c-result.lose { color: #ff6b81; }

.ch-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.ch-head__title {
  font-family: var(--display); font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1; margin: 0;
}
.ch-head__title span { color: var(--ch-accent); display: block; font-size: .55em; font-weight: 600; opacity: .9; }
.ch-head__art {
  width: min(220px, 42vw); border-radius: 12px; display: block;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}

/* Lobby cards with 320 banners */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.ch-card {
  position: relative;
  display: block;
  height: 225px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ch-card:hover { transform: translateY(-4px); box-shadow: 0 22px 48px rgba(255,106,0,.28); }
.ch-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ch-card__info {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.88));
  font-weight: 800; font-size: 16px;
}
.ch-card__info img { width: 28px; height: 28px; object-fit: contain; }
.ch-card.wide { grid-column: span 2; }
@media (max-width: 700px) {
  .ch-card { height: 160px; }
  .ch-card.wide { grid-column: span 1; }
}

/* Shared controls */
.ch-betbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0;
}
.ch-betbar input[type="number"], .ch-betbar input[type="text"] {
  width: 110px; background: #121318; border: 1px solid var(--ch-line);
  color: #fff; border-radius: 10px; padding: 11px 12px; font-weight: 700;
}
.ch-chip {
  background: #2c2e37; border: 1px solid var(--ch-line); color: #d5d7dd;
  border-radius: 8px; padding: 10px 12px; font-weight: 700; cursor: pointer;
}
.ch-chip:hover { border-color: var(--ch-accent); color: #fff; }
.ch-play {
  background: linear-gradient(180deg, #ff9a3d, #ff6a00);
  color: #fff; border: 0; border-radius: 12px; padding: 14px 28px;
  font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 10px 24px rgba(255,106,0,.35);
}
.ch-play:disabled { opacity: .5; cursor: not-allowed; }
.ch-play--ghost {
  background: transparent; border: 1px solid var(--ch-line); color: #fff;
  box-shadow: none;
}

/* Crash */
.ch-crash-panel {
  position: relative;
  background: #121318 url("../images/games/crash-grid.png") center / cover;
  border-radius: 16px; min-height: 220px;
  display: grid; place-items: center; margin-bottom: 14px;
  border: 1px solid var(--ch-line);
}
.ch-crash-phase {
  position: absolute; top: 12px; left: 14px;
  font-weight: 800; font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: rgba(255,255,255,.55);
}
.ch-crash-x {
  font-family: var(--display); font-size: clamp(48px, 8vw, 72px);
  font-weight: 800; letter-spacing: -.04em; color: #fff;
}
.ch-crash-x.is-fail { color: var(--ch-red); }
.ch-history {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.ch-history--live {
  margin: 0 0 12px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.ch-history span {
  background: #2c2e37; border-radius: 8px; padding: 6px 10px;
  font-weight: 800; font-size: 13px; color: #9fe870; white-space: nowrap;
}
.ch-history span.red { color: var(--ch-red); }
.ch-history span.gold { color: #ffd56a; }
.ch-history span.muted { color: #888; background: transparent; font-weight: 600; }
.ch-crash-players {
  margin-top: 12px; border: 1px solid var(--ch-line);
  border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.15);
}
.ch-crash-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--ch-line);
  font-weight: 700; font-size: 13px;
}
.ch-crash-row:last-child { border-bottom: 0; }
.ch-crash-row .ok { color: #9fe870; }
.ch-crash-row small { color: #888; margin-left: 4px; }
.ch-crash-empty { padding: 12px; color: #888; font-weight: 600; font-size: 13px; }

/* Roulette */
.ch-rl-track {
  position: relative;
  background: #121318; border-radius: 14px; padding: 18px 8px 10px;
  margin: 10px 0 16px; overflow: hidden; border: 1px solid var(--ch-line);
}
.ch-rl-cursor {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 28px; z-index: 2; pointer-events: none;
}
.ch-rl-strip {
  display: flex; gap: 10px; width: max-content;
  transition: transform 4s cubic-bezier(.15,.75,.2,1);
}
.ch-rl-item {
  width: 72px; height: 72px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  background: #2a2c35;
}
.ch-rl-item img { width: 56px; height: 56px; object-fit: contain; }
.ch-rl-bets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.ch-rl-bet {
  background: var(--ch-panel); border: 1px solid var(--ch-line);
  border-radius: 14px; padding: 14px; text-align: center; cursor: pointer;
  transition: transform .15s ease, border-color .15s;
}
.ch-rl-bet:hover { transform: translateY(-2px); border-color: var(--ch-accent); }
.ch-rl-bet img { width: 48px; height: 48px; margin-bottom: 8px; }
.ch-rl-bet strong { display: block; font-size: 15px; }
.ch-rl-bet em { color: var(--ch-muted); font-style: normal; font-size: 13px; }
.ch-rl-bet.red .ch-play { background: linear-gradient(180deg, #ff4d6d, #c9033a); }
.ch-rl-bet.green .ch-play { background: linear-gradient(180deg, #3dd68c, #1a9b54); }
.ch-rl-bet.gray .ch-play { background: linear-gradient(180deg, #9ca3af, #4b5563); }
@media (max-width: 700px) {
  .ch-rl-bets { grid-template-columns: 1fr; }
}

/* HiLo */
.ch-hilo {
  display: grid; grid-template-columns: 1fr 160px 1fr; gap: 12px; align-items: stretch;
}
.ch-hilo-card {
  background: linear-gradient(180deg, #fff, #e8e8ee);
  color: #111; border-radius: 16px; min-height: 210px;
  display: grid; place-items: center; font-family: var(--display);
  font-size: 56px; font-weight: 800; cursor: pointer;
  border: 3px solid #fff; box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.ch-hilo-card.is-red { color: #c9033a; }
.ch-hilo-side { display: grid; gap: 10px; }
.ch-hilo-btn {
  border: 0; border-radius: 12px; padding: 16px 12px; font-weight: 800;
  cursor: pointer; color: #fff; font-size: 15px;
}
.ch-hilo-btn.hi { background: linear-gradient(180deg, #ff9a3d, #ff6a00); }
.ch-hilo-btn.lo { background: linear-gradient(180deg, #5b8cff, #2f5fdb); }
.ch-hilo-btn.red { background: linear-gradient(180deg, #ff4d6d, #c9033a); }
.ch-hilo-btn.black { background: linear-gradient(180deg, #4b5563, #111827); }
.ch-hilo-btn:disabled { opacity: .45; cursor: not-allowed; }
.ch-hilo-coef { text-align: center; color: var(--ch-muted); font-weight: 700; font-size: 13px; }
@media (max-width: 800px) {
  .ch-hilo { grid-template-columns: 1fr; }
  .ch-hilo-card { min-height: 160px; order: -1; }
}

/* Battle */
.ch-battle-sides {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0;
}
.ch-battle-side {
  border-radius: 16px; padding: 22px 16px; text-align: center; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s;
}
.ch-battle-side:hover { transform: translateY(-3px); }
.ch-battle-side.red {
  background: linear-gradient(160deg, #5a1424, #c9033a);
}
.ch-battle-side.blue {
  background: linear-gradient(160deg, #0f2748, #2563eb);
}
.ch-battle-side img { width: 64px; height: 64px; margin-bottom: 8px; }
.ch-battle-side strong { display: block; font-size: 20px; }
.ch-battle-vs {
  text-align: center; font-family: var(--display); font-size: 28px;
  color: var(--ch-accent); margin: 4px 0;
}

/* Jackpot */
.ch-jp-pot {
  text-align: center; padding: 24px; border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, #3a2a12, #121318 70%);
  border: 1px solid #5a4018; margin-bottom: 14px;
}
.ch-jp-pot strong {
  display: block; font-family: var(--display); font-size: 42px; color: #ffd27a;
}
.ch-jp-list { display: grid; gap: 8px; margin: 12px 0; }
.ch-jp-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ch-panel); border-radius: 10px; padding: 10px 14px;
  border: 1px solid var(--ch-line);
}
.ch-jp-row.is-you { border-color: var(--ch-accent); }

/* Dice */
.ch-dice-panel {
  background: var(--ch-panel); border-radius: 16px; padding: 18px;
  border: 1px solid var(--ch-line);
}
.ch-dice-roll {
  font-family: var(--display); font-size: 56px; text-align: center;
  margin: 10px 0 4px; color: var(--ch-accent);
}
.ch-dice-meter {
  height: 12px; border-radius: 999px; background: #121318; overflow: hidden;
  margin: 12px 0;
}
.ch-dice-meter > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #ff6a00, #ffd27a);
  width: 50%;
}
.ch-dice-stats {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--ch-muted); font-weight: 700;
}
.ch-dice-stats b { color: #fff; }

/* Mines */
.ch-mines-wrap {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  max-width: 480px; margin: 0 auto 14px;
}
.ch-mines-ind {
  background: var(--ch-panel); border-radius: 12px; padding: 12px 10px;
  text-align: center; border: 1px solid var(--ch-line); min-width: 64px;
}
.ch-mines-ind img { width: 28px; height: 28px; display: block; margin: 0 auto 6px; }
.ch-mines-ind span { font-weight: 800; }
.ch-minefield {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.ch-mine {
  aspect-ratio: 1; border: 0; border-radius: 12px; cursor: pointer;
  background: #2a2c35 url("../images/games/grid.png") center / cover;
  box-shadow: inset 0 0 0 1px var(--ch-line);
}
.ch-mine:disabled { opacity: .7; cursor: default; }
.ch-mine.is-gem {
  background: #1a3a2a url("../images/games/icons/almaz.png") center / 55% no-repeat;
}
.ch-mine.is-bomb {
  background: #3a1520 url("../images/games/icons/bomb.png") center / 55% no-repeat;
}
@media (max-width: 600px) {
  .ch-mines-wrap { grid-template-columns: 1fr; }
  .ch-mines-ind { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
  .ch-mines-ind img { margin: 0; }
}
