.dtr-br-wrapper {
  --dtr-bg: #0d1b3d;
  --dtr-panel: #122758;
  --dtr-panel-2: #1c3979;
  --dtr-accent: #73ff4f;
  --dtr-accent-2: #ffb11a;
  --dtr-text: #f4f7ff;
  --dtr-danger: #ff5b5b;
  width: 100%;
  max-width: 1100px;
  margin: 24px auto;
  color: var(--dtr-text);
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
}

.dtr-br-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #0c1840 0%, #17306c 100%);
  border: 3px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 48px rgba(0,0,0,.35);
}

.dtr-br-canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0d1b3d;
}

.dtr-br-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
}

.dtr-br-button {
  pointer-events: auto;
  border: 0;
  border-radius: 14px;
  padding: 14px 26px;
  font-size: 18px;
  font-weight: 700;
  color: #132100;
  background: linear-gradient(180deg, #9cff6f 0%, #54d338 100%);
  box-shadow: 0 8px 0 #2f8b1e, 0 14px 24px rgba(0,0,0,.25);
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}

.dtr-br-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.dtr-br-button:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #2f8b1e, 0 8px 18px rgba(0,0,0,.25);
}

.dtr-br-mobile-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dtr-br-mobile-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 10px;
  background: linear-gradient(180deg, #1b3472 0%, #102554 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px rgba(0,0,0,.15);
}

.dtr-br-help {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #15306e 0%, #0e214f 100%);
  border: 1px solid rgba(146, 194, 255, .28);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  font-size: 14px;
  line-height: 1.6;
  color: #f8fbff;
}

.dtr-br-help strong {
  color: #ffd861;
  margin-right: 6px;
}

.dtr-br-help span {
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0,0,0,.28);
}

@media (min-width: 860px) {
  .dtr-br-mobile-controls {
    max-width: 420px;
  }
}

@media (max-width: 767px) {
  .dtr-br-button {
    font-size: 16px;
    padding: 12px 20px;
  }

  .dtr-br-help {
    font-size: 13px;
  }
}


.dtr-br-bottom-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.dtr-br-button-secondary {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #334976 0%, #1e2e54 100%);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.dtr-br-button-secondary:hover {
  filter: brightness(1.06);
}


.dtr-br-ranking {
  margin-top: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #11265a 0%, #0c1d47 100%);
  border: 1px solid rgba(146, 194, 255, .22);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}

.dtr-br-ranking-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.dtr-br-ranking h3 {
  margin: 0;
  font-size: 20px;
  color: #fff4c7;
}

.dtr-br-ranking-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.dtr-br-ranking-form label {
  display: grid;
  gap: 6px;
}

.dtr-br-ranking-form span,
.dtr-br-ranking-note {
  color: #dbe7ff;
  font-size: 13px;
}

.dtr-br-ranking-form input {
  min-width: 220px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: #0b1739;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
}

.dtr-br-ranking-list {
  margin: 14px 0 0;
  padding-left: 22px;
}

.dtr-br-ranking-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}

.dtr-br-ranking-list li:last-child { border-bottom: 0; }
.dtr-br-ranking-empty { color: #dbe7ff; opacity: .9; }
.dtr-br-ranking-badge { color: #ffd861; font-weight: 700; }

@media (max-width: 767px) {
  .dtr-br-ranking-form input { min-width: 160px; width: 100%; }
}

.dtr-br-ranking-status{margin-top:10px;color:#fff4c7;font-size:13px;min-height:18px}
.dtr-br-ranking-form input[readonly]{opacity:.92;cursor:default}

.dtr-br-rank-item{display:flex;flex-direction:column;gap:4px;}
.dtr-br-rank-line{display:flex;justify-content:space-between;gap:12px;align-items:center;}
.dtr-br-rank-sub{font-size:12px;opacity:.92;color:#d6f7d6;}
.dtr-br-player-name[readonly]{opacity:.9;cursor:default;background:#13223f;}


.dtr-br-login-callout {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1d336e 0%, #12234f 100%);
  border: 1px solid rgba(255, 217, 97, .32);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  display: grid;
  gap: 8px;
}
.dtr-br-login-callout strong { color: #ffe27d; font-size: 16px; }
.dtr-br-login-callout span, .dtr-br-ranking-guest { color: #eef5ff; font-size: 14px; line-height: 1.5; }
.dtr-br-login-actions { display:flex; gap:10px; flex-wrap:wrap; }
.dtr-br-side-widget {
  border-radius: 16px;
  padding: 16px;
  color: #f7fbff;
  background: linear-gradient(180deg, #10295e 0%, #0c1c45 100%);
  border: 1px solid rgba(146,194,255,.2);
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
}
.dtr-br-side-widget p { margin: 0 0 12px; line-height: 1.6; }
.dtr-br-side-widget-btn {
  display:inline-block;
  text-decoration:none;
  border-radius:12px;
  padding:10px 14px;
  font-weight:700;
  color:#132100;
  background: linear-gradient(180deg, #9cff6f 0%, #54d338 100%);
  box-shadow: 0 8px 0 #2f8b1e;
}


.dtr-br-login-inline {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1e3b82 0%, #112756 100%);
  border: 1px solid rgba(255, 216, 97, .35);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  display: grid;
  gap: 8px;
}
.dtr-br-login-inline strong {
  color: #ffe27d;
  font-size: 16px;
}
.dtr-br-login-inline span {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
}
.dtr-br-side-widget-shortcode h3 {
  margin: 0 0 10px;
  color: #fff4c7;
  font-size: 20px;
}


.dtr-br-login-required {
  position: relative;
  display: grid !important;
}
.dtr-br-login-required::before {
  content: 'LOGIN';
  position: absolute;
  top: -10px;
  right: 14px;
  background: linear-gradient(180deg, #ffd861 0%, #ffb11a 100%);
  color: #2e1900;
  font-weight: 800;
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: 0 6px 14px rgba(0,0,0,.22);
}
.dtr-br-login-inline,
.dtr-br-login-callout {
  display: grid !important;
}


.dtr-br-desktop-wide {
  max-width: 1320px;
}

.dtr-br-frame-wrap {
  display: grid;
  gap: 10px;
}

.dtr-br-frame-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.dtr-br-mobile-orientation {
  display: none;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #193774 0%, #10244f 100%);
  border: 1px solid rgba(255, 217, 97, .32);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.dtr-br-mobile-orientation strong {
  display: block;
  color: #ffe27d;
  margin-bottom: 4px;
}

.dtr-br-mobile-orientation span {
  display: block;
  color: #eef5ff;
  line-height: 1.5;
}

.dtr-br-desktop-ad {
  margin: 12px 0;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #10295e 0%, #0c1c45 100%);
  border: 1px solid rgba(146,194,255,.22);
  box-shadow: 0 12px 24px rgba(0,0,0,.16);
  overflow: auto;
}

.dtr-br-desktop-ad iframe,
.dtr-br-desktop-ad img,
.dtr-br-desktop-ad ins {
  max-width: 100%;
}

.dtr-br-frame-wrap:fullscreen {
  background: #08152f;
  padding: 18px;
}

.dtr-br-frame-wrap:fullscreen .dtr-br-frame {
  max-width: 100%;
}

@media (max-width: 991px) {
  .dtr-br-desktop-ad {
    display: none;
  }
}

@media (max-width: 767px) {
  .dtr-br-mobile-orientation {
    display: block;
  }

  .dtr-br-frame-actions {
    display: none;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .dtr-br-frame {
    outline: 3px solid rgba(255, 216, 97, .28);
  }
}


.dtr-br-mobile-lock {
  display: none;
}

.dtr-br-mobile-lock-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(11,24,64,.96) 0%, rgba(8,17,46,.96) 100%);
  border: 1px solid rgba(255,216,97,.36);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}

.dtr-br-mobile-lock-card strong {
  display: block;
  color: #ffe27d;
  margin-bottom: 6px;
  font-size: 17px;
}

.dtr-br-mobile-lock-card span {
  display: block;
  color: #eef5ff;
  line-height: 1.55;
  font-size: 14px;
}

.dtr-br-fullscreen-side-ad {
  display: none;
  margin-right: auto;
  max-width: min(48vw, 720px);
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #10295e 0%, #0c1c45 100%);
  border: 1px solid rgba(146,194,255,.22);
  overflow: hidden;
}

.dtr-br-fullscreen-side-ad iframe,
.dtr-br-fullscreen-side-ad img,
.dtr-br-fullscreen-side-ad ins {
  max-width: 100%;
}

.dtr-br-frame-actions {
  align-items: center;
  gap: 12px;
}

.dtr-br-frame-wrap.is-fullscreen .dtr-br-fullscreen-side-ad,
.dtr-br-frame-wrap:fullscreen .dtr-br-fullscreen-side-ad {
  display: block;
}

.dtr-br-frame-wrap.is-fullscreen {
  background: #08152f;
  padding: 18px;
}

@media (max-width: 767px) {
  .dtr-br-mobile-lock.is-active {
    display: block;
    margin-bottom: 12px;
  }

  .dtr-br-mobile-lock.is-active + .dtr-br-desktop-ad,
  .dtr-br-mobile-lock.is-active ~ .dtr-br-frame-wrap,
  .dtr-br-mobile-lock.is-active ~ .dtr-br-mobile-controls,
  .dtr-br-mobile-lock.is-active ~ .dtr-br-help,
  .dtr-br-mobile-lock.is-active ~ .dtr-br-desktop-ad-bottom,
  .dtr-br-mobile-lock.is-active ~ .dtr-br-bottom-actions,
  .dtr-br-mobile-lock.is-active ~ .dtr-br-ranking {
    opacity: .34;
    pointer-events: none;
    filter: blur(1px);
  }

  .dtr-br-frame-wrap.is-mobile-full {
    width: 100vw;
    margin-left: calc(50% - 50vw);
  }
}

@media (max-width: 991px) {
  .dtr-br-fullscreen-side-ad {
    display: none !important;
  }
}


@media (max-width: 767px) {
  .dtr-br-mobile-controls {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 30;
    margin-top: 8px;
    padding: 0 4px calc(4px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .dtr-br-mobile-btn {
    padding: 14px 8px;
    min-height: 52px;
    font-size: 15px;
  }

  .dtr-br-frame-wrap.is-mobile-forced-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #08152f;
    margin: 0 !important;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .dtr-br-frame-wrap.is-mobile-forced-fullscreen .dtr-br-frame {
    height: calc(100dvh - 92px - env(safe-area-inset-bottom));
    max-height: none;
    display: flex;
    align-items: stretch;
  }

  .dtr-br-frame-wrap.is-mobile-forced-fullscreen .dtr-br-canvas {
    height: 100%;
    width: 100%;
    object-fit: fill;
  }

  body.dtr-br-body-mobile-fullscreen {
    overflow: hidden;
    touch-action: manipulation;
  }
}


/* v18: ajustes apenas para mobile, mantendo desktop intacto */
@media (max-width: 767px) {
  .dtr-br-wrapper {
    max-width: none;
    margin: 0 auto;
    padding: 0 0 calc(8px + env(safe-area-inset-bottom));
  }

  .dtr-br-frame-wrap {
    gap: 6px;
  }

  .dtr-br-help,
  .dtr-br-ranking,
  .dtr-br-bottom-actions {
    margin-left: 8px;
    margin-right: 8px;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .dtr-br-wrapper {
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .dtr-br-mobile-orientation {
    display: none !important;
  }

  .dtr-br-mobile-lock,
  .dtr-br-mobile-lock.is-active {
    display: block !important;
    margin: 0;
  }

  .dtr-br-mobile-lock-card {
    border-radius: 18px;
    padding: 18px 18px 16px;
  }

  .dtr-br-frame-wrap,
  .dtr-br-mobile-controls,
  .dtr-br-help,
  .dtr-br-bottom-actions,
  .dtr-br-ranking,
  .dtr-br-desktop-ad,
  .dtr-br-frame-actions {
    display: none !important;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  .dtr-br-wrapper {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: 0;
    padding: 6px 0 calc(10px + env(safe-area-inset-bottom));
  }

  .dtr-br-mobile-lock,
  .dtr-br-mobile-lock.is-active,
  .dtr-br-mobile-orientation {
    display: none !important;
  }

  .dtr-br-frame-wrap {
    width: 100%;
    padding: 0 6px;
    box-sizing: border-box;
  }

  .dtr-br-frame {
    border-radius: 14px;
  }

  .dtr-br-canvas {
    width: 100%;
    height: auto;
    min-height: 54vh;
    max-height: 66vh;
    aspect-ratio: 16 / 6;
    object-fit: fill;
  }

  .dtr-br-frame-actions {
    display: none !important;
  }

  .dtr-br-mobile-controls {
    position: sticky;
    bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr 1fr .86fr;
    gap: 6px;
    width: calc(100% - 12px);
    margin: 4px 6px 0;
    padding: 6px;
    border-radius: 14px;
    background: rgba(8, 21, 47, 0.92);
    border: 1px solid rgba(146,194,255,.16);
    box-shadow: 0 10px 24px rgba(0,0,0,.22);
    backdrop-filter: blur(6px);
  }

  .dtr-br-mobile-btn {
    min-height: 48px;
    padding: 10px 6px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.1;
  }

  .dtr-br-help {
    margin-top: 8px;
    padding: 12px 14px;
    font-size: 12px;
  }

  .dtr-br-ranking {
    margin-top: 10px;
  }
}


/* v19: esconder botão de tela cheia apenas no mobile e aproximar controles do rodapé */
@media (max-width: 991px) and (hover: none) and (pointer: coarse), (max-width: 767px) {
  .dtr-br-frame-actions,
  .dtr-br-frame-actions .dtr-br-fullscreen,
  .dtr-br-fullscreen {
    display: none !important;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  .dtr-br-mobile-controls {
    position: fixed;
    left: 6px;
    right: 6px;
    bottom: max(4px, env(safe-area-inset-bottom));
    width: auto;
    margin: 0;
    padding: 5px;
    gap: 5px;
  }

  .dtr-br-wrapper {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .dtr-br-mobile-btn {
    min-height: 46px;
    padding: 9px 6px;
    font-size: 14px;
  }
}
