/* Dice table, controls and recorded-provider presentation measurements. */
.dice-body { background: #0f212e; }
.dice-game-layout { min-height: 0; align-items: start; }
.dice-body .roulette-side { min-height: 530px; background: #213743; border-radius: 8px 0 0 8px; overflow: visible; }
.dice-body .bet-panel { padding: 14px; }
.dice-body .dice-stage { display: grid; gap: 0; padding: 0; background: none; }
.dice-body .segmented { gap: 3px; padding: 5px; margin-bottom: 16px; border: 0; border-radius: 999px; background: #172e3a; }
.dice-body .segmented button { min-height: 40px; border-radius: 999px; box-shadow: none; font-size: 14px; }
.dice-body .segmented button.active { background: #3b596a; color: #fff; }
.dice-body .segmented button[aria-pressed="false"] { background: transparent; color: #e7f0f5; }
.dice-bet-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: #b1c3d1; font-size: 13px; font-weight: 600; }
.dice-bet-label span:last-child { font-size: 11px; font-weight: 400; }
.dice-bet-input { display: grid; grid-template-columns: minmax(0,1fr) 43px 43px; margin-bottom: 12px; border: 2px solid #3c5464; border-radius: 6px; background: #0f212e; overflow: hidden; }
.dice-bet-input input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; margin: 0; border: 0; border-radius: 0; background: #0f212e; color: #fff; font-size: 14px; font-weight: 600; }
.dice-bet-input button { padding: 0; border: 0; background: #3c5464; color: #eaf4fb; font-size: 15px; font-weight: 700; cursor: pointer; }
.dice-bet-input button + button { border-left: 1px solid #617988; }
.dice-bet-input button:hover:not(:disabled) { background: #4d6b7c; }
.dice-bet-input:focus-within, .dice-inline-input:focus-within { border-color: #80bddd; }
.dice-body input[type="number"] { -moz-appearance: textfield; }
.dice-body input::-webkit-inner-spin-button, .dice-body input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dice-body button:focus-visible, .dice-body input:focus-visible, .dice-body select:focus-visible { outline: 2px solid #8bc4e5; outline-offset: 2px; }
.dice-body button:disabled { opacity: .45; cursor: not-allowed; }
.dice-body .bet-action { min-height: 46px; border: 0; border-radius: 6px; background: #1678e5; color: #fff; font-size: 15px; box-shadow: 0 2px 0 #1058ac; }
.dice-body .bet-action:hover:not(:disabled) { background: #2487f2; }
.dice-profit-row { display: grid; gap: 6px; margin-top: 16px; }
.dice-profit-row .label { color: #b1c3d1; font-size: 13px; font-weight: 600; text-transform: none; }
.dice-profit-row output { display: block; min-width: 0; padding: 11px 10px; border: 1px solid #456071; border-radius: 6px; color: #b1c3d1; font-size: 14px; font-variant-numeric: tabular-nums; background: #1b303e; }
.dice-body .shared-tool-row { margin-top: 18px; }
.zero-bet-hint { margin: -3px 0 12px; color: #b1c3d1; font-size: 12px; line-height: 1.45; }
.dice-body .text-button { font-size: 12px; color: #aac1d0; }
.dice-body .game-options-menu { z-index: 30; }
.dice-panel { position: relative; display: grid; grid-template-rows: 42px minmax(265px,1fr) auto; gap: 0; min-width: 0; min-height: 530px; margin: 0; padding: 16px; border: 0; border-radius: 0 8px 0 0; background: #0f212e; box-shadow: none; }
.dice-recent-rolls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; overflow: hidden; }
.dice-recent-rolls:empty { visibility: hidden; }
.dice-recent-rolls > * { flex: 0 0 auto; display: inline-flex; justify-content: center; align-items: center; min-width: 55px; height: 30px; padding: 5px 9px; border: 0; border-radius: 999px; background: #2f4553; color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dice-recent-rolls .win { background: #00e701; color: #062d0a; }
.dice-recent-rolls .loss { background: #2f4553; color: #fff; }
.dice-roll-display { display: grid; align-items: center; width: calc(100% - 48px); max-width: 730px; min-width: 0; margin: 0 auto; padding-top: 32px; }
.dice-track { position: relative; width: 100%; height: 96px; }
.dice-track::before { content: ""; position: absolute; box-sizing: border-box; left: -24px; right: -24px; top: 25px; height: 56px; border: 14px solid #2f4553; border-radius: 999px; background: #0a1c28; box-shadow: inset 0 0 0 5px #17303e; }
.loss-range, .target-range { position: absolute; top: 49px; height: 8px; border-radius: 999px; pointer-events: none; }
.loss-range { background: #e9113c; }
.target-range { background: #00e701; }
.target-handle { position: absolute; left: 50%; top: 35px; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 4px; width: 36px; height: 36px; border-radius: 4px; background: #4a94e9; transform: translateX(-50%); pointer-events: none; box-shadow: 0 2px 5px #07192540; }
.target-handle span { width: 2px; height: 16px; border-radius: 1px; background: #2467ad; }
.track-slider { position: absolute; left: 0; top: 27px; z-index: 4; width: 100%; height: 52px; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.dice-track:has(.track-slider:focus-visible) .target-handle { outline: 3px solid #b6e0ff; outline-offset: 3px; }
.track-slider:disabled { cursor: not-allowed; }
.track-ticks { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; color: #edf5fa; font-size: 14px; font-weight: 700; pointer-events: none; }
.track-ticks span { position: relative; width: 0; display: flex; justify-content: center; }
.track-ticks span::after { content: ""; position: absolute; top: 22px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid #2f4553; }
.roll-marker { position: absolute; top: -73px; left: 50%; z-index: 5; width: 69px; height: 78px; transform: translateX(-50%); transition: left 300ms ease; pointer-events: none; }
.roll-marker[hidden] { display: none; }
.dice-marker-icon { display: block; width: 69px; height: 78px; filter: drop-shadow(0 3px 3px #05131b66); animation: dice-reveal 500ms ease both; }
.dice-result { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); padding: 0; color: #1b303e; font-size: 16px; line-height: 24px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dice-result.win { color: #009600; }
.dice-result.loss { color: #e9113c; }
.dice-result.is-empty { visibility: hidden; }
.roll-marker.instant, .roll-marker.no-animation { transition: none; }
.roll-marker.instant .dice-marker-icon, .roll-marker.no-animation .dice-marker-icon { animation: none; }
@keyframes dice-reveal { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }
.dice-bottom-controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; min-width: 0; padding: 16px; border-radius: 6px; background: #213743; }
.dice-bottom-controls label { display: grid; gap: 7px; min-width: 0; color: #b1c3d1; font-size: 13px; font-weight: 600; }
.dice-inline-input { display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: center; min-width: 0; min-height: 42px; border: 1px solid #456071; border-radius: 6px; background: #122a38; }
.dice-bottom-controls input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 9px; border: 0; border-radius: 6px; background: transparent; color: #fff; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dice-inline-input .icon-button { width: 28px; height: 32px; min-width: 0; min-height: 0; padding: 5px; border: 0; background: transparent; }
.dice-inline-input .icon-button svg { width: 18px; height: 18px; }
.dice-inline-input > span { color: #b1c3d1; text-align: center; font-size: 17px; }
.dice-body .fairness-panel { margin: 0; padding: 15px 18px; border-radius: 0 0 8px 8px; background: #1b3240; }
.dice-body .fairness-panel > summary { color: #b4c8d4; font-size: 13px; }

.basic-auto-rules {
  display: grid;
  gap: 0.8rem;
}

.basic-auto-rules[hidden] {
  display: none;
}

/* Dedicated Custom mode and its condition editor. */
.dice-body [hidden] { display: none !important; }
.dice-body .segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.dice-body .segmented button { min-width: 0; padding-left: 6px; padding-right: 6px; }
.strategy-builder { display: grid; gap: 14px; padding: 0; background: none; }
.dice-run-settings { padding: 0; border: 0; background: transparent; }
.dice-run-settings > summary { padding: 6px 0; color: #b1c3d1; font-size: 12px; font-weight: 600; cursor: pointer; }
.dice-run-settings > summary:focus-visible { outline: 2px solid #8bc4e5; outline-offset: 3px; }
.dice-stop-limits { display: grid; gap: 12px; margin-bottom: 12px; }
.dice-run-settings > summary:not([hidden]) ~ .dice-stop-limits { margin-top: 10px; }
.strategy-play-view { display: grid; gap: 14px; }
.strategy-play-view label, .strategy-manager label { display: grid; gap: 7px; color: #b1c3d1; font-size: 13px; font-weight: 600; }
.strategy-play-view select, .strategy-manager input { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid #456071; border-radius: 6px; background: #122a38; color: #fff; font-size: 14px; }
.strategy-condition-summary { display: grid; gap: 8px; color: #b1c3d1; font-size: 13px; font-weight: 600; }
.strategy-condition-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.strategy-chip { min-width: 40px; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 5px; background: #3c5464; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.strategy-chip.matched { background: #00e701; color: #062d0a; }
.strategy-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.strategy-buttons .button, .add-condition-button { min-height: 40px; padding: 9px 10px; border: 0; border-radius: 5px; background: #3c5464; color: #fff; font-size: 13px; }
.strategy-buttons .button:hover, .add-condition-button:hover { background: #4d6b7c; }
.strategy-editor-dialog { width: min(680px,calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #2f4553; border-radius: 10px; background: #1a2c38; color: #fff; box-shadow: 0 18px 70px #030e16a6; overflow-y: auto; }
.strategy-editor-dialog::backdrop { background: #04131ac9; }
.dice-body:has(#strategyEditorDialog[open]) { overflow: hidden; }
.strategy-edit-view { display: grid; gap: 20px; }
.strategy-editor-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.strategy-editor-header h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.strategy-editor-header .icon-button { min-width: 34px; min-height: 34px; border: 0; border-radius: 5px; background: transparent; color: #b1c3d1; font-size: 28px; cursor: pointer; }
.strategy-manager { display: grid; gap: 7px; }
.strategy-manager .strategy-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 3px; }
.strategy-rows { display: grid; gap: 16px; }
.strategy-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; padding: 16px; border: 1px solid #3a5261; border-radius: 7px; background: #0f212e; }
.strategy-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.strategy-rule-number { margin: 0; font-size: 15px; font-weight: 700; }
.strategy-rule-order { display: flex; gap: 5px; }
.strategy-rule-order button { display: inline-flex; justify-content: center; align-items: center; min-width: 33px; min-height: 32px; padding: 5px; border: 0; border-radius: 4px; background: #2f4553; color: #dceaf3; font-size: 16px; cursor: pointer; }
.strategy-trigger-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.strategy-action-fields { display: grid; grid-template-columns: minmax(0,2fr) minmax(90px,1fr); gap: 10px; }
.strategy-field { display: grid; align-content: start; min-width: 0; gap: 6px; color: #b1c3d1; font-size: 12px; font-weight: 600; }
.strategy-field:has(.strategy-condition) { grid-column: 1 / -1; }
.strategy-field input, .strategy-field select { width: 100%; min-width: 0; min-height: 40px; padding: 8px; border: 1px solid #456071; border-radius: 5px; background: #1a303e; color: #fff; font: inherit; font-size: 13px; }
.strategy-rule-description, .strategy-order-note { margin: 0; color: #b1c3d1; font-size: 12px; line-height: 1.5; font-weight: 400; }
.strategy-rule-description { padding-top: 2px; }
.strategy-editor-status { margin: 0; color: #b1c3d1; font-size: 13px; line-height: 1.45; }
.strategy-editor-status:empty { display: none; }
@media (max-width: 540px) {
  .strategy-editor-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 16px; }
  .strategy-edit-view { gap: 16px; }
  .strategy-row { padding: 12px; gap: 12px; }
  .strategy-trigger-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .strategy-field:has(.strategy-frequency), .strategy-field:has(.strategy-comparison) { grid-column: 1 / -1; }
  .strategy-action-fields { grid-template-columns: minmax(0,1fr); }
  .strategy-manager .strategy-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .strategy-manager .strategy-buttons .button { padding-left: 4px; padding-right: 4px; font-size: 12px; }
}

@media (max-width: 1260px) { .dice-game-layout { margin: 0 18px; } }
@media (max-width: 980px) { .dice-game-layout { grid-template-columns: 260px minmax(0,1fr); } .dice-bottom-controls { padding: 12px 10px; } }
@media (max-width: 760px) {
  .dice-game-layout { display: flex; flex-direction: column; gap: 0; margin: 0 12px; padding-top: 12px; }
  .dice-body .dice-stage { display: contents; }
  .dice-panel { order: 0; width: 100%; min-height: 350px; grid-template-rows: 34px minmax(195px,1fr) auto; padding: 10px; border-radius: 8px 8px 0 0; }
  .dice-body .roulette-side { order: 1; width: 100%; min-height: 0; border-radius: 0; }
  .dice-body .fairness-panel { order: 2; width: 100%; }
  .dice-roll-display { width: calc(100% - 40px); padding-top: 30px; }
  .dice-track::before { left: -18px; right: -18px; border-width: 10px; height: 48px; top: 29px; }
  .track-ticks { font-size: 12px; }
  .dice-bottom-controls { padding: 10px 8px; gap: 6px; }
  .dice-bottom-controls label { gap: 6px; font-size: 11px; }
  .dice-inline-input { grid-template-columns: minmax(0,1fr) 22px; }
  .dice-bottom-controls input { padding: 8px 5px; font-size: 12px; }
  .dice-inline-input .icon-button { width: 22px; padding: 3px; }
  .dice-inline-input .icon-button svg { width: 16px; }
  .dice-recent-rolls > * { min-width: 44px; height: 27px; padding: 4px 7px; font-size: 11px; }
}
@media (max-width: 380px) {
  .dice-game-layout { margin-left: 8px; margin-right: 8px; }
  .dice-panel { padding-left: 8px; padding-right: 8px; }
  .dice-bottom-controls { gap: 5px; padding: 10px 5px; }
  .dice-bottom-controls input { font-size: 11px; padding-left: 4px; padding-right: 2px; }
}
@media (prefers-reduced-motion: reduce) { .roll-marker { transition: none; } .dice-marker-icon { animation: none; } }
