/* ---- The craps table ---- */
/* One end of a craps table seen from above: a dark wooden rail round deep
   green felt. At the head the house, the dice and the puck; then the layout
   printed in gold; then the five seats along the rail. My own chips and
   buttons are under the table. Everything here lives inside #craps. The felt,
   the gold and the wood are the same whatever look the rest of the page has. */
#craps {
  max-width: 880px; margin: 0 auto;
  --cr-gold: #e8c877; --cr-line: rgba(232, 200, 119, 0.8); --cr-cream: #f6f1e1; --cr-red: #a8201a;
  --cr-serif: Georgia, 'Times New Roman', serif;
}
#craps *, #craps *::before, #craps *::after { box-sizing: border-box; }
#craps [hidden] { display: none !important; }
#craps #cr-title { text-align: center; font-weight: 700; font-size: 0.9rem; padding: 0 48px; min-height: 1.3em; margin-bottom: 6px; }

/* The rail and the felt */
#craps #cr-rail {
  padding: 10px; border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0.35)),
    linear-gradient(90deg, #3d2415, #5e3a22 22%, #6e4428 50%, #5e3a22 78%, #3d2415);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.18);
}
#craps #cr-felt {
  position: relative; border-radius: 18px; padding: 10px 10px 12px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 55%),
    radial-gradient(ellipse at 50% 30%, #1d7147, #135336 60%, #0a3622);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 6px 26px rgba(0, 0, 0, 0.45);
  color: #f4f1e6;
}

/* The head of the table: the house, the dice with their total, and the puck */
#craps #cr-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "house puck" "stage stage"; align-items: center; gap: 4px 10px; }
#craps #cr-house { grid-area: house; position: relative; min-width: 0; }
#craps .cr-who { font-weight: 700; font-family: var(--cr-serif); color: var(--cr-gold); font-size: 1rem; }
#craps .cr-badge { display: inline-block; font: 800 0.6rem system-ui, sans-serif; color: #1b1b1b; background: var(--cr-gold); border-radius: 999px; padding: 1px 6px; margin-left: 5px; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }
#craps .cr-note { font-size: 0.78rem; color: rgba(255, 255, 255, 0.72); min-height: 1.2em; font-variant-numeric: tabular-nums; font-weight: 700; }
#craps #cr-notice { text-align: center; font-size: 0.8rem; color: var(--cr-gold); margin: 6px 6px 0; }
#craps #cr-notice:empty { display: none; }
/* The puck: black and OFF before a come-out roll, white and ON when there is a point */
#craps .cr-puck {
  grid-area: puck; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font: 800 0.78rem system-ui, sans-serif; letter-spacing: 0.04em; color: #f4f1e6;
  background: radial-gradient(circle at 35% 30%, #3a3a3a, #0c0c0c 70%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 3px 0 1px #000, 0 6px 8px rgba(0, 0, 0, 0.5);
}
#craps .cr-puck.cr-puck-on { color: #111; background: radial-gradient(circle at 35% 30%, #fff, #d9d6cb 75%); box-shadow: 0 0 0 2px #111, 0 0 0 4px var(--cr-gold), 0 3px 0 4px #8a8777, 0 7px 9px rgba(0, 0, 0, 0.5); }
/* Where the dice are thrown */
#craps #cr-stage { grid-area: stage; display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 84px; padding: 8px 0 14px; overflow: hidden; }
#craps #cr-dice { display: flex; gap: 12px; }
#craps .cr-die {
  position: relative; width: 56px; height: 56px; border-radius: 19%;
  background: linear-gradient(145deg, #fffdf3 0%, #f4ecd6 55%, #e3d7b6 100%);
  box-shadow: 0 3px 0 #b3a57f, 0 8px 12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}
#craps .cr-die.cr-blank { opacity: 0.25; }
#craps .cr-face { position: absolute; inset: 16%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6%; }
#craps .cr-face i { border-radius: 50%; }
#craps .cr-face i.cr-pip { background: radial-gradient(circle at 35% 30%, #4a4034, #17130d 70%); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6); }
#craps #cr-dice.cr-tumble .cr-die { animation: cr-throw var(--cr-ms, 1300ms) cubic-bezier(0.2, 0.7, 0.3, 1) both; }
#craps #cr-dice.cr-tumble .cr-die + .cr-die { animation-name: cr-throw-b; }
@keyframes cr-throw {
  0% { transform: translate(-240px, -22px) rotate(-560deg) scale(0.8); }
  45% { transform: translate(18px, 6px) rotate(-110deg) scale(1.06); }
  65% { transform: translate(-8px, -12px) rotate(-40deg); }
  85% { transform: translate(3px, 2px) rotate(8deg); }
  100% { transform: none; }
}
@keyframes cr-throw-b {
  0% { transform: translate(-300px, 14px) rotate(-420deg) scale(0.8); }
  50% { transform: translate(24px, -4px) rotate(130deg) scale(1.06); }
  70% { transform: translate(-6px, -10px) rotate(40deg); }
  88% { transform: translate(2px, 2px) rotate(-7deg); }
  100% { transform: none; }
}
#craps #cr-total { min-width: 1.5em; text-align: center; font: 700 2.8rem/1 var(--cr-serif); font-variant-numeric: lining-nums; color: var(--cr-gold); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
#craps #cr-total.cr-seven-up { color: #ff9c8f; }
#craps #cr-total.cr-rolling::before { content: '···'; font-size: 1.8rem; animation: cr-wait 0.9s ease-in-out infinite alternate; }
#craps #cr-total.cr-pop { animation: cr-pop 0.35s ease-out; }
@keyframes cr-wait { from { opacity: 0.25; } }
@keyframes cr-pop { from { opacity: 0; scale: 0.6; } }
/* The stickman's call */
#craps #cr-call { text-align: center; font: italic 700 1.05rem var(--cr-serif); color: var(--cr-cream); min-height: 1.35em; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
/* The last fifteen rolls, the newest first: sevens in red, a point set ringed in gold, a point made filled with it */
#craps #cr-history { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 22px; margin-top: 6px; }
#craps .cr-h { min-width: 22px; height: 22px; padding: 0 3px; border-radius: 11px; display: grid; place-items: center; font: 700 0.7rem var(--cr-serif); color: #fff; background: rgba(0, 0, 0, 0.42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
#craps .cr-h.cr-h-seven { background: var(--cr-red); }
#craps .cr-h.cr-h-point { box-shadow: inset 0 0 0 2px var(--cr-gold); color: var(--cr-gold); }
#craps .cr-h.cr-h-made { background: var(--cr-gold); color: #1b1b1b; }
#craps .cr-h.cr-h-new { outline: 2px solid #fff; outline-offset: 1px; }

/* ---- The layout ---- */
/* On a phone it stands upright: the six numbers in two rows, then Come, the
   Field, Don't pass and the Pass line, each a strip wide enough to tap; the
   centre bets below. On a wide screen it lies as at a real table (further down). */
#craps #cr-layout { display: grid; gap: 8px; margin-top: 10px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#craps #cr-end {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 76px 76px 60px 72px 58px 62px;
  grid-template-areas: "n4 n4 n5 n5 n6 n6" "n8 n8 n9 n9 n10 n10" "dc dc come come come come" "field field field field field field" "dp dp dp dp dp dp" "pass pass pass pass pass pass";
}
#craps .cr-area {
  position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; padding: 5px 2px 0;
  border: 1px solid var(--cr-line); text-align: center; -webkit-tap-highlight-color: transparent;
}
#craps .cr-n4 { grid-area: n4; } #craps .cr-n5 { grid-area: n5; } #craps .cr-n6 { grid-area: n6; }
#craps .cr-n8 { grid-area: n8; } #craps .cr-n9 { grid-area: n9; } #craps .cr-n10 { grid-area: n10; }
#craps .cr-dc { grid-area: dc; } #craps .cr-come { grid-area: come; } #craps .cr-field { grid-area: field; }
#craps .cr-dp-h { grid-area: dp; } #craps .cr-pass-h { grid-area: pass; border-radius: 0 0 16px 16px; }
#craps .cr-pass-v, #craps .cr-dp-v { display: none; }
/* On a phone the two long strips have their names at the left, clear of the odds spot at the right */
#craps .cr-pass-h, #craps .cr-dp-h { align-items: flex-start; padding-left: 12px; }
#craps .cr-lbl { font: 700 0.86rem/1.1 var(--cr-serif); color: var(--cr-cream); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
#craps .cr-sub { font: 700 0.6rem/1.1 system-ui, sans-serif; color: var(--cr-gold); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
#craps .cr-sub em { font: 700 0.8rem var(--cr-serif); font-style: normal; color: var(--cr-cream); letter-spacing: 0.08em; }
#craps .cr-num { background: rgba(0, 0, 0, 0.12); }
#craps .cr-num .cr-lbl { font-size: 1.5rem; line-height: 1; letter-spacing: 0.02em; font-variant-numeric: lining-nums; color: var(--cr-gold); }
#craps .cr-come .cr-lbl { font-size: 1.35rem; letter-spacing: 0.2em; color: #f3b2a6; }
#craps .cr-dc .cr-lbl { font-size: 0.72rem; white-space: normal; }
#craps .cr-pass .cr-lbl { font-size: 1.05rem; letter-spacing: 0.16em; }
#craps .cr-dp .cr-lbl { font-size: 0.86rem; display: inline-flex; align-items: center; gap: 6px; }
#craps .cr-field { background: rgba(0, 0, 0, 0.1); }
#craps .cr-nums { font: 700 1.05rem/1.2 var(--cr-serif); color: var(--cr-gold); font-variant-numeric: lining-nums; white-space: nowrap; }
#craps .cr-nums b { display: inline-grid; place-items: center; min-width: 1.55em; height: 1.55em; border-radius: 50%; border: 1px solid var(--cr-line); color: var(--cr-cream); margin: 0 3px; }
/* The puck on the number that is the point */
#craps .cr-on { display: none; position: absolute; top: 3px; right: 3px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; place-items: center; font: 800 0.55rem system-ui, sans-serif; font-style: normal; color: #111; background: radial-gradient(circle at 35% 30%, #fff, #d9d6cb 75%); box-shadow: 0 0 0 1px #111, 0 2px 4px rgba(0, 0, 0, 0.6); }
#craps .cr-num.cr-point { background: rgba(232, 200, 119, 0.16); box-shadow: inset 0 0 0 2px var(--cr-gold); }
#craps .cr-num.cr-point .cr-on { display: grid; }
/* Small dice printed on the layout: the pairs of the hardways, and the two sixes of "bar 12" */
#craps .cr-mini { position: relative; display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: linear-gradient(145deg, #fffdf3, #e3d7b6); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); vertical-align: middle; flex: none; }
#craps .cr-mini .cr-face { inset: 13%; gap: 4%; }
#craps .cr-mini .cr-face i.cr-pip { background: #1a1510; box-shadow: none; }
#craps .cr-bar, #craps .cr-pair { display: inline-flex; gap: 3px; }
#craps .cr-pair .cr-mini { width: 22px; height: 22px; border-radius: 5px; }
/* The centre of the table: any seven, the hardways, any craps */
#craps #cr-props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 56px 68px; grid-template-areas: "seven seven craps craps" "h4 h6 h8 h10"; background: rgba(0, 0, 0, 0.14); }
#craps .cr-seven { grid-area: seven; } #craps .cr-craps { grid-area: craps; }
#craps .cr-h4 { grid-area: h4; } #craps .cr-h6 { grid-area: h6; } #craps .cr-h8 { grid-area: h8; } #craps .cr-h10 { grid-area: h10; }
#craps .cr-prop .cr-lbl { font-size: 0.82rem; color: #f3b2a6; }
/* What cannot be bet on right now is dimmed (the chips on it are not) */
#craps .cr-area.cr-shut > .cr-lbl, #craps .cr-area.cr-shut > .cr-sub, #craps .cr-area.cr-shut > .cr-nums, #craps .cr-area.cr-shut > .cr-pair, #craps .cr-area.cr-shut > .cr-bar { opacity: 0.4; }
#craps .cr-area.cr-shut { background-color: rgba(0, 0, 0, 0.16); }
#craps #cr-layout.cr-open .cr-area:not(.cr-shut) { cursor: pointer; }
#craps #cr-layout.cr-open .cr-area:not(.cr-shut):active { background-color: rgba(255, 233, 168, 0.22); }
@media (hover: hover) {
  #craps #cr-layout.cr-open .cr-area:not(.cr-shut):hover { background-color: rgba(255, 233, 168, 0.12); }
}
/* Odds: a spot behind my line bet, there once a point is on */
#craps .cr-odds { position: absolute; top: 4px; bottom: 4px; right: 5px; width: 84px; padding: 3px 2px 0; border: 1px dashed var(--cr-gold); border-radius: 9px; background: rgba(0, 0, 0, 0.22); z-index: 3; }
#craps .cr-pass-h > .cr-stacks, #craps .cr-dp-h > .cr-stacks { right: 94px; }

/* A player's chips on the layout: a chip seen from above with the amount on it, ringed in the player's colour */
#craps .cr-p0 { --cr-seat: #4fc3f7; }
#craps .cr-p1 { --cr-seat: #ff9a62; }
#craps .cr-p2 { --cr-seat: #d7a3e6; }
#craps .cr-p3 { --cr-seat: #b4e06a; }
#craps .cr-p4 { --cr-seat: #fff176; }
#craps .cr-c100 { --chip: #1b1b1d; --chip-edge: #000; }
#craps .cr-c500 { --chip: #6d3fa0; --chip-edge: #4a2a70; }
#craps .cr-c1000 { --chip: #d39a1c; --chip-edge: #94690c; }
#craps .cr-stacks { position: absolute; left: 2px; right: 2px; bottom: 4px; z-index: 4; display: flex; flex-wrap: wrap-reverse; justify-content: center; gap: 4px 5px; pointer-events: none; }
#craps .cr-stack {
  position: relative; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, var(--chip) 0 52%, rgba(255, 255, 255, 0.9) 53% 60%, var(--chip) 61% 100%);
  border: 2px dashed rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px var(--cr-seat), 0 3px 0 1px var(--chip-edge), 0 5px 6px rgba(0, 0, 0, 0.55);
}
#craps .cr-stack-amt { font: 800 0.54rem system-ui, sans-serif; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000, 0 0 3px #000; letter-spacing: -0.02em; }
/* In a number's box: C for a come bet that has travelled there, DC for a don't come */
#craps .cr-tag { position: absolute; top: -7px; right: -7px; min-width: 13px; height: 13px; padding: 0 2px; border-radius: 7px; display: grid; place-items: center; font: 800 0.5rem system-ui, sans-serif; font-style: normal; color: #111; background: var(--cr-cream); box-shadow: 0 0 0 1px #111; }
#craps .cr-tag.cr-tag-dc { background: #111; color: #fff; box-shadow: 0 0 0 1px #fff; }
/* A bet that is off for the next roll (a place bet or a hardway on the come-out) */
#craps .cr-stack.cr-off { filter: saturate(0.5) brightness(0.8); }
/* After the roll: the bets that won light up, the ones that lost fade */
#craps .cr-stack.cr-won { z-index: 2; animation: cr-won 0.5s ease-in-out infinite alternate; }
#craps .cr-stack.cr-lost { opacity: 0.3; filter: grayscale(0.8); }
@keyframes cr-won { to { scale: 1.25; box-shadow: 0 0 0 2px var(--cr-seat), 0 0 0 4px #fff, 0 0 16px 6px rgba(255, 233, 168, 0.95); } }

/* The seats along the rail: picture, name, chips */
#craps #cr-seats { display: flex; justify-content: center; align-items: flex-start; gap: 3px; margin-top: 12px; }
#craps .cr-seat { position: relative; flex: 1 1 0; min-width: 0; max-width: 170px; display: flex; flex-direction: column; align-items: center; text-align: center; }
#craps .cr-seat.cr-gone { opacity: 0.6; }
#craps .cr-seat.cr-vacant { cursor: pointer; }
#craps .cr-plate {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-width: 0;
  padding: 3px 4px 4px; border-radius: 9px; background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(255, 255, 255, 0.12); border-top: 3px solid var(--cr-seat);
}
#craps .cr-seat.cr-me .cr-plate { background: rgba(0, 0, 0, 0.62); border-color: var(--cr-seat); }
#craps .cr-seat.cr-banker .cr-plate { box-shadow: 0 0 0 2px var(--cr-gold); }
#craps .cr-seat.cr-shooting .cr-plate { box-shadow: 0 0 0 2px #fff, 0 0 12px 2px rgba(255, 255, 255, 0.35); }
#craps .cr-seat.cr-empty .cr-plate { background: none; border-color: transparent; border-top-color: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.6); }
#craps .cr-seat.cr-empty .cr-foot, #craps .cr-seat.cr-empty .cr-cam { display: none; }
#craps .cr-seat.cr-empty .cr-name { white-space: normal; font-weight: 600; font-size: 0.72rem; }
#craps .cr-seat.cr-vacant .cr-name { text-decoration: underline; color: #fff; }
#craps .cr-cam { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #000; box-shadow: 0 0 0 2px var(--cr-seat); flex: none; }
#craps .cr-cam.blank { display: none; }
#craps .cr-name { max-width: 100%; font-weight: 700; font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#craps .cr-name .cr-badge { display: block; margin: 1px auto 0; width: max-content; }
#craps .cr-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cr-seat); margin-right: 4px; }
/* The shooter's plate carries a pair of dice */
#craps .cr-shooter { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: -1px; }
#craps .cr-shooter i { width: 10px; height: 10px; border-radius: 2.5px; background: radial-gradient(circle, #17130d 0 22%, transparent 26%), linear-gradient(145deg, #fffdf3, #e3d7b6); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); }
#craps .cr-shooter i + i { rotate: 14deg; }
#craps .cr-stackline { max-width: 100%; font-size: 0.68rem; color: var(--cr-gold); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#craps .cr-given { font-size: 0.62rem; color: rgba(255, 255, 255, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Up or down since sitting down */
#craps .cr-net { font-size: 0.68rem; font-weight: 800; color: rgba(255, 255, 255, 0.75); white-space: nowrap; font-variant-numeric: tabular-nums; }
#craps .cr-net-up { color: #8fe0ad !important; }
#craps .cr-net-down { color: #ffb4a9 !important; }
#craps .cr-foot { font-size: 0.66rem; min-height: 1.25em; margin-top: 2px; color: rgba(255, 255, 255, 0.75); font-variant-numeric: tabular-nums; }
#craps .cr-placed { color: var(--cr-gold); font-weight: 700; }
#craps .cr-up-chips { color: #8fe0ad; font-weight: 800; }
#craps .cr-down-chips { color: #ffb4a9; font-weight: 800; }

/* Speech bubbles: the house's under its name, a player's above the seat */
#craps .cr-bubble {
  position: absolute; z-index: 8; left: 50%; transform: translateX(-50%); top: calc(100% + 6px);
  width: max-content; max-width: min(300px, 80vw); padding: 7px 11px; text-align: center;
  background: #fdfdfd; color: #161616; border-radius: 12px; font: 600 0.88rem/1.25 system-ui, sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); pointer-events: none;
}
#craps .cr-bubble::after { content: ''; position: absolute; left: 50%; margin-left: -6px; top: -12px; border: 6px solid transparent; border-bottom-color: #fdfdfd; }
#craps .cr-bubble.cr-up { top: auto; bottom: calc(100% + 4px); max-width: 190px; }
#craps .cr-bubble.cr-up::after { top: auto; bottom: -12px; border-bottom-color: transparent; border-top-color: #fdfdfd; }
#craps .cr-bubble.cr-pop { animation: cr-pop 0.22s ease-out; }
#craps #cr-house-bubble { left: 0; transform: none; }
#craps #cr-house-bubble::after { left: 34px; }

/* Under the table: what is going on, the shooter's button, the limits, and my chips and buttons */
#craps #cr-status { text-align: center; font-weight: 700; min-height: 1.5em; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
#craps #cr-roll { min-height: 56px; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
#craps #cr-limits { margin: 8px 0 0; text-align: center; }
#craps #cr-error { text-align: center; min-height: 1.2em; margin: 2px 0 0; }
#craps #cr-mine { margin: 6px 0 0; text-align: center; min-height: 1.2em; font-variant-numeric: tabular-nums; }
#craps #cr-chips { justify-content: center; gap: 16px; }
#craps #cr-chips .cr-chip {
  flex: none; width: 62px; height: 62px; min-height: 0; padding: 0; border-radius: 50%;
  font-weight: 800; font-size: 0.84rem; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000;
  background: radial-gradient(circle, var(--chip) 0 52%, rgba(255, 255, 255, 0.92) 53% 57%, var(--chip) 58% 100%);
  border: 5px dashed rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 -1px var(--chip-edge), 0 7px 10px rgba(0, 0, 0, 0.5);
  transition: translate 0.12s, box-shadow 0.12s;
}
/* The chip I am betting with stands a little higher, with a bright ring */
#craps #cr-chips .cr-chip.cr-on-chip { translate: 0 -5px; box-shadow: 0 0 0 3px var(--accent), 0 6px 0 2px var(--chip-edge), 0 12px 14px rgba(0, 0, 0, 0.55); }
#craps #cr-chips .cr-chip:disabled { opacity: 0.4; }
/* My bets, one button each: tap one to take it down */
#craps #cr-my-bets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
#craps #cr-my-bets:empty { display: none; }
#craps .cr-pill { min-height: 40px; padding: 0 12px; border-radius: 999px; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
#craps .cr-pill.cr-locked { opacity: 0.6; border-style: dashed; }
#craps .cr-pill.cr-picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#craps #cr-house-box { margin-top: 10px; }
#craps #cr-house-text { margin-top: 6px; }
#craps #cr-leave { margin-top: 6px; }
/* The house's own settings: how big the bets may be, and chips for the players */
#craps #cr-max-box, #craps #cr-give-box { margin-top: 8px; }
#craps #cr-max-box p, #craps #cr-give-box p { margin: 0 0 4px; text-align: center; }
#craps #cr-max-box #cr-max-text { margin: 4px 0 0; }
#craps #cr-max, #craps #cr-give { flex-wrap: wrap; justify-content: center; }
#craps #cr-max button { flex: 1 1 70px; min-height: 40px; padding: 0 6px; }
#craps #cr-max button.picked { background: var(--t15); color: #1b1b1b; border-color: var(--t15); }
#craps #cr-give button { flex: 1 1 150px; min-height: 44px; }
#craps #cr-give-amount { justify-content: center; align-items: center; gap: 12px; margin-bottom: 6px; }
#craps #cr-give-amount button { flex: none; width: 48px; min-height: 44px; padding: 0; font-size: 1.3rem; font-weight: 800; }
#craps #cr-give-now { min-width: 90px; text-align: center; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--t15); }
/* How to play */
#craps #cr-how { margin-top: 14px; padding: 8px 12px; border: 1px solid var(--t0); border-radius: 10px; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
#craps #cr-how summary { cursor: pointer; font-weight: 700; color: var(--text); min-height: 32px; display: flex; align-items: center; }
#craps #cr-how summary::before { content: '▸'; margin-right: 8px; }
#craps #cr-how[open] summary::before { content: '▾'; }
#craps #cr-how summary::-webkit-details-marker { display: none; }
#craps #cr-how p { margin: 6px 0; }
#craps #cr-how b { color: var(--text); }

@media (max-width: 699px) {
  #craps { padding-top: 46px; } /* room for the row of round buttons along the top */
  #craps #cr-title { padding: 0; }
  #craps #cr-rail { padding: 7px; border-radius: 20px; }
  #craps #cr-felt { padding: 8px 6px 10px; border-radius: 14px; }
  #craps .cr-bubble.cr-up { max-width: 160px; }
  #craps #cr-house-bubble { max-width: 250px; }
  /* Bubbles stay inside the screen: the seats at the edges hang theirs inwards. */
  #craps .cr-seat:nth-child(-n+2) .cr-bubble.cr-up { left: 0; transform: none; }
  #craps .cr-seat:nth-child(-n+2) .cr-bubble.cr-up::after { left: 24px; }
  #craps .cr-seat:nth-child(n+4) .cr-bubble.cr-up { left: auto; right: 0; transform: none; }
  #craps .cr-seat:nth-child(n+4) .cr-bubble.cr-up::after { left: auto; right: 18px; }
}
@media (max-width: 379px) {
  #craps .cr-nums { font-size: 0.92rem; }
  #craps .cr-nums b { margin: 0 1px; }
  #craps .cr-field .cr-sub { font-size: 0.54rem; letter-spacing: 0; }
  #craps .cr-odds { width: 70px; }
  #craps .cr-pass-h > .cr-stacks, #craps .cr-dp-h > .cr-stacks { right: 78px; }
  #craps .cr-pass .cr-lbl { letter-spacing: 0.08em; }
}
@media (min-width: 700px) {
  #craps #cr-seats { gap: 8px; }
  #craps .cr-plate { padding: 4px 8px 5px; }
  #craps .cr-cam { width: 54px; height: 54px; }
  #craps .cr-name { font-size: 0.84rem; }
  #craps .cr-dot { display: inline-block; }
  #craps .cr-stackline { font-size: 0.76rem; }
  #craps .cr-foot { font-size: 0.74rem; }
  #craps .cr-die { width: 66px; height: 66px; }
  #craps #cr-total { font-size: 3.4rem; }
}

/* Wide screens: the page gets the room a craps table needs, and the layout
   lies as at a real table. The Pass line runs along the bottom and curves up
   the end of the table, with the Don't pass bar inside it; the Don't come box
   and the six numbers along the top, Come and the Field under them; the
   centre bets in a block of their own to the right. */
@media (min-width: 760px) {
  main:has(#craps:not([hidden])), body > :has(> #craps:not([hidden])) { max-width: 980px; }
  #craps { max-width: 960px; }
  #craps #cr-rail { padding: 13px; }
  #craps #cr-felt { padding: 14px 18px 16px; }
  #craps #cr-top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "house stage puck"; }
  #craps #cr-stage { min-height: 100px; min-width: 380px; }
  #craps .cr-puck { justify-self: end; width: 54px; height: 54px; font-size: 0.9rem; }
  #craps .cr-who { font-size: 1.15rem; }
  #craps #cr-call { font-size: 1.2rem; }
  #craps .cr-h { min-width: 26px; height: 26px; border-radius: 13px; font-size: 0.8rem; }
  #craps #cr-layout { grid-template-columns: minmax(0, 1fr) 232px; gap: 12px; margin-top: 14px; }
  #craps #cr-end {
    grid-template-columns: 52px 52px minmax(0, 1.2fr) repeat(6, minmax(0, 1fr)); grid-template-rows: 108px 66px 70px 56px 62px;
    grid-template-areas:
      "pv dv dc n4 n5 n6 n8 n9 n10"
      "pv dv come come come come come come come"
      "pv dv field field field field field field field"
      "pv dp dp dp dp dp dp dp dp"
      "pass pass pass pass pass pass pass pass pass";
  }
  /* The two L shapes: an upright strip and a flat one that share a corner. The
     line between them is left out, and the flat strip draws its own top line
     from where the upright one ends. */
  #craps .cr-pass-v, #craps .cr-dp-v { display: flex; justify-content: center; padding: 0; border-bottom: 0; }
  #craps .cr-pass-v { grid-area: pv; border-radius: 14px 0 0 0; }
  #craps .cr-dp-v { grid-area: dv; }
  #craps .cr-pass-h, #craps .cr-dp-h { border-top-color: transparent; padding: 0; }
  #craps .cr-pass-h { border-radius: 0 0 14px 48px; }
  #craps .cr-dp-h { border-radius: 0 0 0 28px; }
  #craps .cr-pass-h::before, #craps .cr-dp-h::before { content: ''; position: absolute; top: -1px; left: 51px; right: -1px; border-top: 1px solid var(--cr-line); pointer-events: none; }
  #craps .cr-pass-h > .cr-lbl, #craps .cr-dp-h > .cr-lbl { position: absolute; left: 70px; top: 50%; translate: 0 -50%; }
  #craps .cr-pass-h > .cr-stacks, #craps .cr-dp-h > .cr-stacks { left: 250px; right: 110px; bottom: 50%; translate: 0 50%; }
  #craps .cr-turned { writing-mode: vertical-rl; rotate: 180deg; }
  #craps .cr-pass .cr-lbl { font-size: 1.15rem; letter-spacing: 0.22em; }
  #craps .cr-dp-v .cr-lbl { font-size: 0.8rem; letter-spacing: 0.12em; }
  #craps .cr-num { padding-top: 10px; }
  #craps .cr-num .cr-lbl { font-size: 1.9rem; }
  #craps .cr-num .cr-sub { font-size: 0.64rem; }
  #craps .cr-dc { justify-content: center; gap: 6px; padding-top: 0; }
  #craps .cr-dc .cr-lbl { font-size: 0.84rem; line-height: 1.25; }
  #craps .cr-dc > .cr-stacks, #craps .cr-come > .cr-stacks { bottom: 6px; }
  #craps .cr-come .cr-lbl { font-size: 1.9rem; letter-spacing: 0.34em; }
  #craps .cr-nums { font-size: 1.3rem; letter-spacing: 0.04em; }
  #craps .cr-nums b { margin: 0 10px; }
  #craps .cr-odds { width: 96px; }
  #craps .cr-on { width: 30px; height: 30px; font-size: 0.66rem; top: 4px; right: 4px; }
  #craps #cr-props { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 64px minmax(0, 1fr) minmax(0, 1fr) 64px; grid-template-areas: "seven seven" "h4 h10" "h6 h8" "craps craps"; }
  #craps .cr-prop { justify-content: center; padding-top: 0; }
  #craps .cr-prop .cr-lbl { font-size: 1rem; letter-spacing: 0.14em; }
  #craps .cr-prop > .cr-stacks { left: auto; right: 4px; bottom: 50%; translate: 0 50%; width: 64px; }
  #craps .cr-hard { padding-top: 12px; gap: 4px; }
  #craps .cr-pair .cr-mini { width: 28px; height: 28px; border-radius: 6px; }
  #craps .cr-stack { width: 26px; height: 26px; }
  #craps .cr-stack-amt { font-size: 0.58rem; }
  #craps #cr-bet-box, #craps #cr-house-box, #craps #cr-rebuy-box, #craps #cr-add-box, #craps #cr-roll-box, #craps #cr-limits, #craps #cr-how, #craps #cr-status ~ .row { max-width: 600px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  #craps #cr-dice.cr-tumble .cr-die, #craps .cr-stack.cr-won, #craps #cr-total.cr-pop, #craps #cr-total.cr-rolling::before, #craps .cr-bubble.cr-pop { animation: none; }
  #craps #cr-chips .cr-chip { transition: none; }
}
