/* 2048 challenge rooms — loaded after main.css */
.challenge-page .container { padding-bottom: 40px; }
.ch-nav { font-size: 14px; margin: 0 0 14px; color: #8f7a66; }
.ch-nav a { color: #8f7a66; }
.ch-h1 { font-size: 34px; line-height: 1.2; margin: 6px 0 10px; color: #776e65; }
.ch-mode { margin: 0; font-size: 14px; font-weight: bold; color: #8f7a66; text-transform: uppercase; letter-spacing: .5px; }
.ch-beat { font-size: 22px; margin: 6px 0; }
.ch-beat strong { color: #f65e3b; font-size: 30px; }
.ch-beat span { font-size: 16px; color: #8f7a66; }
.ch-sub { line-height: 1.5; }

.ch-form { background: #eee4da; border-radius: 8px; padding: 16px; margin: 16px 0; }
.ch-form label { display: block; font-weight: bold; margin-bottom: 6px; }
.ch-form input[type=text], .ch-form input:not([type]), #ch-name {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 18px;
  padding: 10px 12px; border: 2px solid #bbada0; border-radius: 6px; background: #fff; margin-bottom: 12px;
}
.ch-modes { border: 0; padding: 0; margin: 0 0 12px; }
.ch-modes legend { font-weight: bold; margin-bottom: 6px; }
.ch-mode-opt { display: block; background: #f9f6f2; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-weight: normal !important; }
.ch-mode-opt span { display: block; font-size: 14px; color: #8f7a66; margin-left: 22px; }

.ch-btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: bold;
  background: #8f7a66; color: #f9f6f2 !important; border-radius: 4px; padding: 0 14px; height: 38px; line-height: 38px; font-size: 15px;
}
.ch-btn:disabled { opacity: .6; cursor: default; }
.ch-btn-big { width: 100%; height: 50px; line-height: 50px; font-size: 20px; }
.ch-btn-small { height: 32px; line-height: 32px; font-size: 13px; }
.ch-btn-light { background: #bbada0; }
.ch-form input.ch-invalid { border-color: #c0392b; background: #fdecea; }
.ch-error { color: #c0392b; font-weight: bold; margin: 10px 0 0; }
.ch-note { font-size: 13px; color: #8f7a66; margin: 8px 0 0; }

.ch-share-box { margin: 18px 0; }
.ch-link { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px 10px; border: 2px dashed #bbada0; border-radius: 6px; background: #fff; color: #776e65; }
.ch-share-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ch-share-btns .s-ms { background: #0084ff; }
.ch-share-btns .s-wa { background: #25d366; }
.ch-share-btns .s-fb { background: #1877f2; }
.ch-share-btns .s-x { background: #111; }
.ch-share-btns .s-native { background: #f65e3b; }

.ch-title { font-size: 60px !important; }
.ch-top:after { content: "TO BEAT" !important; }
.ch-bar { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; }
.ch-timer-wrap { font-size: 24px; font-weight: bold; }
#ch-timer.low { color: #f65e3b; }
.ch-ending { text-align: center; font-weight: bold; font-size: 18px; margin-top: 12px; }
.ch-help { font-size: 14px; color: #8f7a66; text-align: center; }

.ch-stats { display: flex; gap: 8px; margin: 10px 0; }
.ch-stats div { flex: 1; background: #bbada0; border-radius: 6px; padding: 10px 6px; text-align: center; color: #fff; }
.ch-stats span { display: block; font-size: 12px; text-transform: uppercase; color: #eee4da; }
.ch-stats strong { font-size: 24px; }
.ch-lead { font-size: 18px; font-weight: bold; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-login { font-size: 14px; }

.ch-board-wrap h2 { font-size: 22px; margin: 28px 0 8px; }
#ch-board { width: 100%; border-collapse: collapse; font-size: 15px; }
#ch-board th, #ch-board td { padding: 7px 6px; border-bottom: 1px solid #e3dbd2; text-align: left; }
#ch-board .num { text-align: right; }
#ch-board tr.me td { background: #f3d774; font-weight: bold; }
#ch-board .ch-empty { text-align: center; color: #8f7a66; padding: 16px; }

/* ---------- live ranking ---------- */
.ch-rank { font-size: 15px; color: #8f7a66; }
.ch-rank strong { font-size: 22px; color: #776e65; }
.ch-live { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 10px; background: #e8f5e9; color: #2e7d32; font-size: 11px; font-weight: bold; vertical-align: middle; }
.ch-live:before, .ch-live-dot { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; margin-right: 4px; vertical-align: middle; animation: ch-pulse 1.2s infinite; }
.ch-live-dot { width: 9px; height: 9px; margin-left: 4px; }
@keyframes ch-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
#ch-board tr.live td { color: #5b6b5f; }
#ch-toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -80px); z-index: 1000;
  padding: 10px 18px; border-radius: 22px; background: #776e65; color: #fff; font-weight: bold; font-size: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); transition: transform .25s ease; pointer-events: none; white-space: nowrap;
}
#ch-toast.show { transform: translate(-50%, 0); }
#ch-toast.up { background: #2e7d32; }
#ch-toast.down { background: #c0392b; }

@media screen and (max-width: 520px) {
  .ch-h1 { font-size: 26px; }
  .ch-title { font-size: 27px !important; }
  .ch-stats strong { font-size: 18px; }
}
