:root { --game: #e11d48; }
.rc-stage { margin-top: 8px; padding: 0 3px; }
.fd-shell {
  max-width: 720px;
  margin: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 0 35px #e11d4814;
}
.fd-shell h1 { margin: 0; font-size: clamp(1.6rem, 6vw, 2rem); }
.fd-sub { color: var(--text-dim); margin: 2px 0 10px; font-size: .86rem; }
.fd-controls, .fd-hud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.fd-controls label, .fd-hud { color: var(--text-dim); font-size: .85rem; }
.fd-controls button, .fd-controls select {
  min-height: 40px;
  padding: 6px 9px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid #484851;
  border-radius: 9px;
}
.fd-controls select { font-size: 16px; }
.fd-controls button:disabled { opacity: .45; }
.fd-hud { justify-content: space-between; }
.fd-hud strong, #turn { color: var(--text); }
#daily-label { color: var(--game); font-weight: 700; }
#message { min-height: 1.4em; margin: 4px 0 8px; color: #fb7185; font-weight: 650; }
.fd-board { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fd-tray {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 9px 5px 8px;
  margin-bottom: 9px;
  background: #202026;
  border: 1px solid #383840;
  border-radius: 14px;
  box-shadow: 0 4px 15px #0006;
}
.fd-dice { display: flex; justify-content: space-between; gap: 3px; }
.fd-die {
  width: min(16vw, 66px);
  min-width: 52px;
  height: 67px;
  padding: 3px;
  color: #202026;
  background: var(--text);
  border: 3px solid transparent;
  border-radius: 11px;
  touch-action: manipulation;
  transition: transform .14s ease;
}
.fd-die.held { transform: translateY(-5px); border-color: var(--game); }
.fd-die small { display: block; height: 12px; line-height: 12px; font-size: 9px; font-weight: 900; }
.fd-face { position: relative; display: block; height: 44px; }
.pip { display: none; position: absolute; width: 8px; height: 8px;
  border-radius: 50%; background: #25252b; }
.p0 { left: 7px; top: 4px; } .p1 { left: calc(50% - 4px); top: 4px; }
.p2 { right: 7px; top: 4px; } .p3 { left: 7px; top: 18px; }
.p4 { left: calc(50% - 4px); top: 18px; } .p5 { right: 7px; top: 18px; }
.p6 { left: 7px; bottom: 3px; } .p7 { left: calc(50% - 4px); bottom: 3px; }
.p8 { right: 7px; bottom: 3px; }
[data-value="1"] .p4,
[data-value="2"] .p0, [data-value="2"] .p8,
[data-value="3"] .p0, [data-value="3"] .p4, [data-value="3"] .p8,
[data-value="4"] .p0, [data-value="4"] .p2, [data-value="4"] .p6,
[data-value="4"] .p8,
[data-value="5"] .p0, [data-value="5"] .p2, [data-value="5"] .p4,
[data-value="5"] .p6, [data-value="5"] .p8,
[data-value="6"] .p0, [data-value="6"] .p2, [data-value="6"] .p3,
[data-value="6"] .p5, [data-value="6"] .p6, [data-value="6"] .p8 { display: block; }
#roll {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 5px;
  color: white;
  background: var(--game);
  border: 0;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  touch-action: manipulation;
}
#roll.off { opacity: .5; }
.fd-card { overflow: hidden; border: 1px solid #3a3a43; border-radius: 12px; }
.fd-row { display: grid; grid-template-columns: minmax(0, 1.8fr)
  repeat(var(--players), minmax(0, 1fr)); min-height: 43px; }
.fd-row > * { min-width: 0; padding: 4px 6px; border-bottom: 1px solid #303038; }
.fd-row > * + * { border-left: 1px solid #303038; text-align: center; }
.fd-head { font-weight: 700; background: #292931; }
.fd-head .active { color: #fb7185; }
.fd-section { padding: 6px 8px; color: #fb7185; background: #251b25;
  font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.fd-label { display: flex; flex-direction: column; justify-content: center; }
.fd-label strong { font-size: .84rem; }
.fd-label small { color: var(--text-dim); font-size: .68rem; }
.fd-box {
  min-height: 43px;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-weight: 750;
  font-size: 1rem;
  touch-action: manipulation;
}
.fd-box.active { color: var(--text); background: #3b2030; }
.fd-box.zero { color: #989098; }
.fd-box.filled { color: #c3c3cc; }
.fd-total { background: #27272e; font-weight: 750; align-items: stretch; }
.fd-total > * { display: flex; align-items: center; justify-content: center; }
.fd-total > :first-child { justify-content: flex-start; font-size: .83rem; }
#total-row { color: #fb7185; font-size: 1.1rem; }
.fd-board :focus-visible, .fd-controls :focus-visible { outline: 3px solid #fef08a; outline-offset: -3px; }
.fd-die.hint, .fd-box.hint, #roll.hint { box-shadow: 0 0 0 3px #fef08a; }
.tumble { animation: tumble .4s ease-in-out; }
.pulse { animation: pulse .65s ease-in-out 2; }
.flash { animation: flash .6s ease-out; }
@keyframes tumble { 50% { transform: rotate(12deg) scale(.92); } }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 4px #fef08a; } }
@keyframes flash { 50% { background: #e11d4866; } }
@media (min-width: 600px) {
  .fd-shell { padding: 16px 20px; }
  .fd-play { display: grid; grid-template-columns: 230px 1fr; gap: 12px; align-items: start; }
  .fd-tray { position: sticky; top: 8px; }
  .fd-die { min-width: 41px; width: 41px; height: 58px; }
  .fd-face { height: 36px; }
  .pip { width: 7px; height: 7px; }
  .p0, .p3, .p6 { left: 3px; } .p2, .p5, .p8 { right: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}

/* Keep the floating feedback launcher over labels, away from dice and score boxes. */
#rfbLaunch { left: max(14px, env(safe-area-inset-left)) !important;
  right: auto !important; }
