/* Bet: the hub (bet/) and the small games inside it (bet/four/, bet/rps/) */

.bt-login { text-align: center; }
.bt-login h2 { font-family: var(--font-display); margin: 6px 0 4px; }
.bt-login-art { display: flex; justify-content: center; gap: 8px; }
.bt-big { width: 72px; height: 72px; }

.bt-h { font: 600 1.25rem/1.2 var(--font-display); margin: 0 0 12px; }
.bt-sec { margin: 0 0 22px; }
.bt-new { margin: 0 0 22px; }

/* game tiles */
.bt-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 16px; }
.bt-game {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer;
  font: 600 .95rem/1.15 var(--font-display); text-align: center;
  transition: transform .15s, border-color .15s, background .15s;
}
.bt-game:hover { transform: translateY(-2px); border-color: var(--ink); }
.bt-game.on { border-color: var(--ink); background: var(--accent); color: #1d1b16; box-shadow: 0 4px 0 var(--ink); }
.bt-game-art { width: 56px; height: 56px; }

.bt-field { margin-bottom: 14px; }
.bt-field > label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.bt-field .input { width: 100%; }
.bt-stake-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bt-stake-row .input { flex: 0 1 170px; min-width: 0; }
.bt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-chip {
  padding: 7px 13px 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--soft); cursor: pointer;
  font: 600 .9rem/1 var(--font-display); color: var(--muted);
}
.bt-chip:hover { color: var(--ink); border-color: var(--ink); }
.bt-chip.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.bt-pot { margin: 4px 0 14px; color: var(--muted); }
.bt-pot b { color: var(--ink); }
.bt-bad, .bt-res.bt-bad { color: var(--bad); }
.bt-good, .bt-res.bt-good { color: var(--good); }

/* a challenge or game in a list */
.bt-list { display: flex; flex-direction: column; gap: 8px; }
.bt-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; }
.bt-row-art { width: 40px; height: 40px; flex: none; }
.bt-row-main { flex: 1; min-width: 0; }
.bt-row-t { font-weight: 800; overflow-wrap: anywhere; }
.bt-row-t a { text-decoration: none; }
.bt-row-t a:hover { text-decoration: underline; }
.bt-row-s { font-size: .88rem; color: var(--muted); }
.bt-row-r { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; flex: none; text-align: right; }
.bt-res { font-weight: 800; }
.bt-view { font-size: .85rem; color: var(--muted); }
#bt-in .bt-row { border-color: var(--ink); background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
@media (max-width: 520px) {
  .bt-row { flex-wrap: wrap; }
  .bt-row-r { width: 100%; justify-content: flex-start; padding-left: 52px; }
}

/* ------------------------------------------------------------ a game page (duel.js) */

.dl-card { padding: 18px; }
.dl-head { display: flex; align-items: center; gap: 10px; }
.dl-p {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 2px solid var(--line); border-radius: 14px; transition: border-color .2s, background .2s;
}
.dl-p1 { flex-direction: row-reverse; text-align: right; }
.dl-p.on { border-color: var(--ink); background: color-mix(in srgb, var(--accent) 25%, var(--card)); }
.dl-name { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-name a { text-decoration: none; }
.dl-you { font: 700 .7rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .05em; padding: 3px 6px; border-radius: 6px; background: var(--ink); color: var(--card); vertical-align: 2px; }
.dl-vs { font: 600 .9rem/1 var(--font-display); color: var(--muted); }
.dl-score { font: 700 1.5rem/1 var(--font-display); }
.dl-pot { text-align: center; margin: 10px 0 4px; color: var(--muted); }
.dl-pot b { color: var(--ink); }
.dl-status { text-align: center; font-weight: 700; margin: 6px 0 12px; min-height: 1.5em; }
.dl-clock { display: inline-block; min-width: 3.2em; padding: 2px 8px; margin-left: 4px; border-radius: 8px; background: var(--soft); font-variant-numeric: tabular-nums; }
.dl-clock.low { background: var(--bad); color: #fff; }
.dl-end { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin: 8px 0 14px; padding: 12px; border-radius: 16px; background: var(--soft); }
.dl-end b { font: 700 1.5rem/1.2 var(--font-display); }
.dl-end.good b { color: var(--good); }
.dl-end.bad b { color: var(--bad); }
.dl-end span { color: var(--muted); }
.dl-end .btn { margin-top: 6px; }
.dl-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.dl-watch { text-align: center; margin: 12px 0 0; }

/* Connect Four */
.c4-disc, .c4-cell, .c4-ghost { display: block; border-radius: 50%; border: 2.5px solid #1d1b16; }
.c4-disc { width: 22px; height: 22px; flex: none; }
.d0.c4-disc, .d0.c4-cell, .d0.c4-ghost { background: #ff5d5d; }
.d1.c4-disc, .d1.c4-cell, .d1.c4-ghost { background: #ffd23f; }
.c4 {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  max-width: 470px; margin: 0 auto; padding: 8px; border: 2.5px solid #1d1b16; border-radius: 18px;
  background: #3d8bff; box-shadow: 0 6px 0 #1d1b16;
}
.c4-col {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 4px; margin: 0;
  border: 0; border-radius: 12px; background: none; cursor: default;
}
.c4-col.can { cursor: pointer; }
.c4-col.can:hover, .c4-col.can:focus-visible { background: rgba(255, 255, 255, .22); outline: none; }
.c4-cell { width: 100%; aspect-ratio: 1; background: #e8f2ff; }
.c4-cell.d0, .c4-cell.d1 { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }
.c4-cell.last { outline: 3px solid #fff; outline-offset: 1px; }
.c4-cell.fall { animation: c4-fall calc(.12s + var(--fall) * .05s) cubic-bezier(.5, 0, 1, 1); }
@keyframes c4-fall { from { transform: translateY(calc(var(--fall) * -112%)); } }
.c4-cell.win { animation: c4-win .7s ease-in-out infinite alternate; outline: 3px solid #fff; outline-offset: 1px; }
@keyframes c4-win { to { transform: scale(.8); } }
.c4-ghost { position: absolute; left: 50%; top: -30px; width: 60%; aspect-ratio: 1; transform: translateX(-50%); opacity: 0; transition: opacity .15s; pointer-events: none; }
.c4-col.can:hover .c4-ghost, .c4-col.can:focus-visible .c4-ghost { opacity: 1; }
.dl-four .dl-board { padding-top: 26px; }

/* Rock Paper Scissors */
.rp-mark { display: none; }
.rp-reveal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; margin: 4px 0 16px; }
.rp-reveal.pop .rp-side { animation: rp-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.rp-reveal.pop .rp-side:last-of-type { animation-delay: .08s; }
@keyframes rp-pop { from { transform: scale(.3) rotate(-14deg); opacity: 0; } }
.rp-side { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; }
.rp-big { width: 86px; height: 86px; }
.rp-vs { font: 600 1.1rem/1 var(--font-display); color: var(--muted); }
.rp-res { flex-basis: 100%; text-align: center; margin: 0; font: 600 1.15rem/1.3 var(--font-display); }
.rp-res.good, .rp-hist .good { color: var(--good); }
.rp-res.bad, .rp-hist .bad { color: var(--bad); }
.rp-none { display: inline-flex; align-items: center; justify-content: center; border: 2.5px dashed var(--line); border-radius: 50%; font: 700 1.6rem/1 var(--font-display); color: var(--muted); }
.rp-none.rp-sm { font-size: .9rem; border-width: 2px; }
.rp-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 440px; margin: 0 auto; }
.rp-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 10px;
  border: 2.5px solid var(--ink); border-radius: 18px; background: var(--card); box-shadow: 0 5px 0 var(--ink);
  font: 600 1rem/1 var(--font-display); cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.rp-pick:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 0 var(--ink); }
.rp-pick:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.rp-pick:disabled { cursor: default; opacity: .45; box-shadow: none; transform: translateY(5px); }
.rp-pick.on:disabled { opacity: 1; background: var(--accent); color: #1d1b16; }
.rp-art { width: 64px; height: 64px; }
.rp-hist { list-style: none; margin: 18px auto 0; padding: 0; max-width: 340px; display: flex; flex-direction: column; gap: 4px; }
.rp-hist li { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 10px; background: var(--soft); font-size: .92rem; }
.rp-hist li > .muted:first-child { width: 1.6em; }
.rp-hist b { margin-left: auto; }
.rp-sm { width: 28px; height: 28px; }
@media (max-width: 520px) {
  .rp-art { width: 48px; height: 48px; }
  .rp-big { width: 70px; height: 70px; }
  .dl-p { padding: 6px 8px; }
}

/* open games and practice (the hub) */
.bt-row.bt-yours { border-style: dashed; border-color: var(--ink); }
.bt-wait { color: var(--ink); font-weight: 700; }
.bt-wait::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--good); vertical-align: 2px; animation: bt-blink 1.2s ease-in-out infinite; }
@keyframes bt-blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .bt-wait::after { animation: none; } }
.bt-short { opacity: .5; }
.bt-empty { margin: 0; padding: 14px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; }
.bt-note { margin: 10px 0 0; font-size: .88rem; text-align: center; }
.bt-solo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.bt-solo-a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--card); color: inherit; text-decoration: none; line-height: 1.25; transition: transform .15s, border-color .15s;
}
.bt-solo-a:hover { transform: translateY(-2px); border-color: var(--ink); }
.bt-solo-a .muted { font-size: .88rem; }
