/* FREE CASINO ONLINE · Craps */
.cr-app {
  min-height: 100vh;
  min-height: 100dvh;
}

.cr-main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: calc(100vh - var(--fc-header-h) - 2px);
  min-height: calc(100dvh - var(--fc-header-h) - 2px);
  display: flex;
  align-items: stretch;
}

.cr-stage {
  order: 1;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px 18px 18px 8px;
  display: flex;
}

.cr-table {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(246, 216, 128, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(18, 105, 61, 0.24), transparent 74%),
    linear-gradient(180deg, #05160d 0%, #04110a 100%);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.5),
    inset 0 0 100px rgba(0, 0, 0, 0.48);
}

#cr-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.cr-title {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.cr-title .fc-table-title {
  margin-top: 4px;
  font-size: clamp(30px, 3vw, 44px);
}

.cr-point-puck {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 5;
  width: 80px;
  height: 80px;
  display: grid;
  place-content: center;
  gap: 1px;
  border: 1px solid rgba(246, 216, 128, 0.38);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 238, 184, 0.18), transparent 55%),
    rgba(3, 18, 10, 0.86);
  color: var(--fc-gold);
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.cr-point-puck span {
  font-family: var(--fc-body);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.cr-point-puck strong {
  font-family: var(--fc-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 0.9;
  color: var(--fc-gold-bright);
}

.cr-scoreline {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid rgba(246, 216, 128, 0.2);
  border-radius: 999px;
  background: rgba(3, 18, 10, 0.72);
  color: var(--fc-muted-soft);
  font-family: var(--fc-body);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
}

.cr-scoreline strong {
  color: var(--fc-gold-bright);
  font-family: var(--fc-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.cr-toast {
  position: absolute;
  left: 50%;
  bottom: 24%;
  z-index: 7;
  min-width: 170px;
  padding: 12px 22px;
  border: 1px solid rgba(246, 216, 128, 0.4);
  border-radius: 14px;
  background: rgba(2, 15, 8, 0.92);
  color: var(--fc-gold-bright);
  font-family: var(--fc-display);
  font-size: 28px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cr-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.cr-toast[data-tone="lose"] {
  color: #ffc0b7;
  border-color: rgba(255, 160, 150, 0.35);
}

.cr-toast[data-tone="win"] {
  color: #e8ce88;
}

.cr-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(2, 10, 6, 0.78);
  color: var(--fc-gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
  transition: opacity 0.35s ease;
}

.cr-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.cr-loading-ring {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(246, 216, 128, 0.16);
  border-top-color: var(--fc-gold);
  border-radius: 50%;
  animation: cr-spin 0.8s linear infinite;
}

@keyframes cr-spin {
  to { transform: rotate(360deg); }
}

.cr-cam {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 9;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(246, 216, 128, 0.28);
  border-radius: 50%;
  background: rgba(3, 20, 12, 0.78);
  color: var(--fc-gold);
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 240, 184, 0.08);
  backdrop-filter: blur(10px);
}

.cr-cam svg {
  width: 22px;
  height: 22px;
}

.cr-cam:hover {
  border-color: rgba(246, 216, 128, 0.58);
  background: rgba(10, 36, 22, 0.9);
}

/* Panel ------------------------------------------------------------------ */
.cr-panel {
  order: 0;
  flex: 0 0 372px;
  width: 372px;
  max-height: calc(100vh - var(--fc-header-h) - 36px);
  max-height: calc(100dvh - var(--fc-header-h) - 36px);
  margin: 18px 0 18px 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--fc-line);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 100% 32% at 50% 0%, rgba(232, 191, 98, 0.08), transparent 68%),
    linear-gradient(158deg, rgba(9, 35, 21, 0.96) 0%, rgba(4, 18, 11, 0.95) 58%, rgba(3, 14, 9, 0.97) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 230, 162, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 191, 98, 0.28) transparent;
}

.cr-panel::-webkit-scrollbar {
  width: 6px;
}

.cr-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(232, 191, 98, 0.26);
}

.cr-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(246, 216, 128, 0.12);
}

.cr-panel .fc-bet-title {
  font-size: 27px;
  line-height: 0.9;
}

.cr-bet-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.cr-type {
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid rgba(246, 216, 128, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: #bdb49f;
  font-family: var(--fc-body);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.cr-type.is-active {
  border-color: rgba(246, 216, 128, 0.55);
  background: rgba(232, 191, 98, 0.12);
  color: var(--fc-gold-bright);
}

.cr-type:disabled {
  opacity: 0.35;
}

.cr-point-line {
  min-height: 16px;
  color: var(--fc-gold);
  font-family: var(--fc-body);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.cr-bet-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(246, 216, 128, 0.16);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.18);
}

.cr-bet-display > span {
  color: var(--fc-muted-soft);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.cr-bet-display strong {
  color: var(--fc-gold-bright);
  font-family: var(--fc-display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.cr-bet-display small {
  color: var(--fc-muted-soft);
  font-family: var(--fc-body);
  font-size: 7px;
  font-weight: 800;
}

.cr-chip-block .fc-label {
  display: block;
  margin-bottom: 7px;
}

.cr-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cr-roll {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255, 240, 184, 0.55);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffe9a3 0%, #e3b454 48%, #bd8626 100%);
  color: #1d1304;
  font-family: var(--fc-body);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(198, 146, 43, 0.22);
}

.cr-roll:disabled {
  opacity: 0.45;
  cursor: default;
}

.cr-message {
  min-height: 18px;
  color: #b9b19d;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.cr-rules {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(246, 216, 128, 0.12);
  color: #a9a08d;
  font-size: 9px;
  line-height: 1.5;
}

.cr-rules summary {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fc-gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
  list-style: none;
  cursor: pointer;
}

.cr-rules summary::-webkit-details-marker { display: none; }
.cr-rules summary::before { content: "+"; font-size: 13px; }
.cr-rules[open] summary::before { content: "−"; }
.cr-rules ul { margin: 8px 0 0; padding: 0 0 0 16px; }
.cr-rules li { margin-bottom: 4px; }

@media (max-width: 1180px) {
  .cr-panel {
    flex-basis: 338px;
    width: 338px;
    padding: 17px;
  }
  .cr-panel .fc-bet-title { font-size: 24px; }
}

@media (max-width: 900px) {
  .cr-main {
    flex-direction: column;
    min-height: 0;
  }

  .cr-stage {
    order: 1;
    flex: 0 0 auto;
    height: clamp(310px, 44vh, 460px);
    padding: 8px 10px 0;
  }

  .cr-table {
    min-height: 0;
    border-radius: 22px;
  }

  .cr-panel {
    order: 2;
    flex: 0 0 auto;
    width: calc(100% - 20px);
    max-height: none;
    margin: 10px auto 24px;
    padding: 16px 14px 150px;
    border-radius: 20px;
    overflow: visible;
    animation: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
  }

  .cr-panel-head {
    display: none;
  }

  .cr-panel .fc-bet-title {
    font-size: 21px;
  }

  .cr-bet-types {
    gap: 6px;
  }

  .cr-type {
    min-height: 36px;
    font-size: 7.5px;
  }

  .cr-chip-block {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom));
    z-index: 60;
    margin: 0;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(246, 216, 128, 0.18);
    background: linear-gradient(180deg, rgba(4, 18, 10, 0.95), rgba(2, 10, 6, 0.99));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.3);
  }

  .cr-chip-block .fc-label {
    display: none;
  }

  .cr-chip-row {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 5px;
  }

  .cr-chip-row .fc-chip {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 13.5px;
  }

  .cr-roll {
    position: fixed;
    left: 9px;
    right: 9px;
    width: auto;
    bottom: calc(9px + env(safe-area-inset-bottom));
    z-index: 61;
    min-height: 40px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 9px;
  }

  .cr-bet-display {
    display: none;
  }

  .cr-point-line {
    margin-top: 2px;
  }

  .cr-message {
    margin-top: 2px;
  }

  .cr-rules {
    margin-top: 8px;
  }

  .cr-title {
    top: 12px;
  }

  .cr-point-puck {
    top: 12px;
    right: 12px;
    width: 60px;
    height: 60px;
  }

  .cr-point-puck strong {
    font-size: 24px;
  }

  .cr-scoreline {
    right: 14px;
    bottom: 14px;
  }

  .cr-cam {
    left: 10px;
    bottom: 10px;
    width: 42px;
    height: 42px;
  }

  .cr-cam svg { width: 20px; height: 20px; }
}

@media (max-width: 700px) {
  .cr-stage {
    height: clamp(280px, 42vh, 420px);
  }

  .cr-cam {
    left: 8px;
    bottom: 8px;
    width: 40px;
    height: 40px;
  }

  .cr-cam svg { width: 19px; height: 19px; }

  .cr-title .fc-table-title {
    font-size: 27px;
  }

  .cr-scoreline {
    padding: 5px 9px;
  }

  .cr-scoreline strong {
    font-size: 15px;
  }
}


.cr-fixed-stake {
  display: none;
}

@media (max-width: 900px) {
  .cr-fixed-stake {
    display: block;
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--fc-gold);
    font-family: var(--fc-body);
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }
}

/* Botones de apuesta y tirada con tamaño legible */
.cr-type {
  min-height: 46px;
  font-size: 18px;
  font-family: var(--fc-display);
  letter-spacing: 0.05em;
}
.cr-roll {
  min-height: 52px;
  font-size: 18px;
  font-family: var(--fc-display);
  letter-spacing: 0.06em;
}
@media (max-width: 900px) {
  .cr-type {
    min-height: 40px;
    font-size: 16px;
  }
  .cr-roll {
    min-height: 48px;
    font-size: 16px;
  }
}

/* Formulario de apuesta manual al lado de las fichas */
.cr-chip-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}
.cr-chip-block .fc-label {
  flex: 0 0 100%;
}
.cr-chip-row {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 5px;
}
.cr-chip-row .fc-chip {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  font-size: 13.5px;
}
.cr-manual-bet {
  flex: 1 1 140px;
  min-width: 118px;
  padding-top: 5px;
  border-top: 1px solid rgba(246, 216, 128, 0.14);
}
.cr-manual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.cr-manual-head label {
  color: var(--fc-gold-bright);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cr-manual-head .cr-fixed-stake {
  margin: 0;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.cr-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}
.cr-manual-row input {
  min-width: 0;
  height: 32px;
  padding: 0 7px;
  border: 1px solid rgba(246, 216, 128, 0.25);
  border-radius: 7px;
  background: #06180f;
  color: #fff;
  font: inherit;
  font-size: 11px;
}
.cr-manual-row input:focus {
  outline: none;
  border-color: rgba(255, 230, 162, 0.7);
}
.cr-manual-row button {
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(246, 216, 128, 0.45);
  border-radius: 7px;
  background: #183523;
  color: var(--fc-gold-bright);
  font: inherit;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}
.cr-manual-row button:hover { background: #214c32; }
@media (max-width: 900px) {
  .cr-chip-block {
    flex-wrap: nowrap;
    align-items: center;
  }
  .cr-chip-block .fc-label { display: none; }
  .cr-manual-bet {
    flex: 1 1 0;
    min-width: 0;
    border-top: 0;
    padding-top: 0;
  }
}
