.cf-dragon-village-card .village-card-icon img {
  filter: drop-shadow(0 0 8px rgba(255, 119, 24, .7)) drop-shadow(0 3px 2px rgba(0, 0, 0, .75));
}

.cf-dragon-village-live {
  color: #2a1304;
  background: linear-gradient(#ffd979, #e89536);
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 8px;
  font-weight: 1000;
  line-height: 1;
}

.cf-dragon-open {
  overflow: hidden;
}

.cf-dragon-page {
  position: fixed;
  inset: 0;
  z-index: 10045;
  display: flex;
  justify-content: center;
  color: #f7ecd2;
  background: #080d0a;
  font-family: inherit;
}

.cf-dragon-page[hidden] {
  display: none !important;
}

.cf-dragon-panel {
  width: min(100%, var(--game-shell-width, 430px));
  max-width: var(--game-shell-width, 430px);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 0, rgba(160, 65, 17, .24), transparent 36%),
    linear-gradient(165deg, rgba(18, 38, 26, .98), rgba(8, 20, 14, .99));
  box-shadow: 0 0 60px rgba(0, 0, 0, .7), inset 0 0 60px rgba(221, 118, 40, .05);
}

.cf-dragon-header {
  flex: 0 0 auto;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr minmax(72px, auto);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(232, 179, 92, .25);
  background: rgba(7, 18, 12, .88);
}

.cf-dragon-header > div {
  min-width: 0;
  text-align: center;
}

.cf-dragon-header h2 {
  margin: 0;
  color: #ffe29a;
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.1;
}

.cf-dragon-header small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #b9c9b9;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-dragon-back {
  width: fit-content;
  min-width: 68px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid rgba(236, 185, 99, .38);
  border-radius: 12px;
  color: #fff2ce;
  background: rgba(54, 69, 49, .8);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.cf-dragon-back span {
  font-size: 20px;
  line-height: 1;
}

.cf-dragon-scroll {
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.cf-dragon-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.cf-dragon-hero {
  position: relative;
  min-height: clamp(215px, 46vw, 330px);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(229, 166, 71, .32);
  border-radius: 19px;
  background:
    radial-gradient(circle at 50% 65%, rgba(218, 94, 24, .3), transparent 35%),
    radial-gradient(circle at 50% 15%, rgba(75, 129, 72, .35), transparent 53%),
    linear-gradient(#122b1e, #07130d);
}

.cf-dragon-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 58%, rgba(3, 10, 6, .93));
  pointer-events: none;
}

.cf-dragon-hero img {
  position: absolute;
  inset: -7% 0 0;
  width: 100%;
  height: 108%;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .7));
}

.cf-dragon-hero.away img {
  opacity: .56;
  filter: grayscale(.2) drop-shadow(0 16px 22px rgba(0, 0, 0, .7));
  transform: translateY(18%);
}

.cf-dragon-fire {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 126, 24, .38), transparent 68%);
  filter: blur(8px);
  animation: cf-dragon-pulse 2.4s ease-in-out infinite;
}

@keyframes cf-dragon-pulse {
  50% { opacity: .55; transform: scale(.9); }
}

.cf-dragon-hero-copy {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 13px;
  z-index: 2;
  display: grid;
  gap: 4px;
  text-align: center;
  text-shadow: 0 2px 4px #000;
}

.cf-dragon-hero-copy strong {
  color: #ffe09a;
  font-size: clamp(21px, 5vw, 28px);
}

.cf-dragon-hero-copy span {
  color: #f6ead1;
  font-weight: 700;
}

.cf-dragon-card,
.cf-dragon-result,
.cf-dragon-loading,
.cf-dragon-error {
  margin-bottom: 11px;
  padding: 13px;
  border: 1px solid rgba(224, 180, 98, .23);
  border-radius: 15px;
  background: rgba(11, 29, 19, .78);
}

.cf-dragon-card h3,
.cf-dragon-result h3 {
  margin: 0 0 10px;
  color: #f8d98f;
  font-size: 16px;
}

.cf-dragon-card p {
  margin: 0;
  line-height: 1.45;
}

.cf-dragon-bar-label,
.cf-dragon-total-reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cf-dragon-bar-label b,
.cf-dragon-total-reward b {
  color: #ffe3a0;
  text-align: right;
}

.cf-dragon-bar {
  height: 18px;
  overflow: hidden;
  margin: 8px 0 13px;
  border: 1px solid rgba(255, 190, 93, .3);
  border-radius: 999px;
  background: #351918;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .55);
}

.cf-dragon-bar i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #a93022, #ec6d28 72%, #ffbc51);
  box-shadow: 0 0 13px rgba(255, 111, 35, .56);
  transition: width .35s ease;
}

.cf-dragon-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 11px;
}

.cf-dragon-stats > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 9px 5px;
  border-radius: 11px;
  background: rgba(3, 13, 8, .48);
  text-align: center;
}

.cf-dragon-stats span {
  font-size: 19px;
}

.cf-dragon-stats small,
.cf-dragon-personal small,
.cf-dragon-attack-card small {
  color: #adbdad;
  font-size: 11px;
}

.cf-dragon-stats b {
  max-width: 100%;
  overflow: hidden;
  color: #fff0c9;
  font-size: 13px;
  text-overflow: ellipsis;
}

.cf-dragon-personal {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cf-dragon-personal > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.cf-dragon-personal b {
  color: #ffe5aa;
  overflow-wrap: anywhere;
}

.cf-dragon-attack-card {
  display: grid;
  gap: 9px;
}

.cf-dragon-player-hp > span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  text-align: center;
}

.cf-dragon-player-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #311a1b;
}

.cf-dragon-player-bar i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #b5363a, #ee6b70);
}

.cf-dragon-combats {
  justify-self: center;
  padding: 5px 11px;
  border: 1px solid rgba(241, 190, 94, .2);
  border-radius: 999px;
  color: #f5deb0;
  background: rgba(4, 14, 9, .4);
  font-size: 12px;
  font-weight: 800;
}

.cf-dragon-attack {
  min-height: 50px;
  border: 1px solid #e9aa4d;
  border-radius: 13px;
  color: #2b1808;
  background: linear-gradient(#ffd67c, #e58a32);
  box-shadow: inset 0 1px rgba(255, 255, 255, .48), 0 5px 15px rgba(150, 67, 21, .28);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.cf-dragon-attack:disabled {
  opacity: .5;
  filter: grayscale(.35);
  cursor: default;
}

.cf-dragon-attack-card > small {
  text-align: center;
}

.cf-dragon-result {
  border-color: rgba(255, 170, 69, .52);
  background: linear-gradient(135deg, rgba(77, 42, 18, .88), rgba(21, 44, 26, .88));
  animation: cf-dragon-result-in .3s ease-out;
}

.cf-dragon-result.victory {
  border-color: rgba(255, 220, 106, .76);
  box-shadow: 0 0 22px rgba(255, 183, 54, .15);
}

@keyframes cf-dragon-result-in {
  from { opacity: 0; transform: translateY(8px); }
}

.cf-dragon-result > div {
  margin-top: 5px;
}

.cf-dragon-result-main {
  color: #ffbd73;
  font-size: 19px;
  font-weight: 900;
}

.cf-dragon-result-main strong,
.cf-dragon-result .good {
  color: #bff2c8;
}

.cf-dragon-result-breakdown {
  display: grid;
  gap: 6px;
  margin: 9px 0;
}

.cf-dragon-result-hit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 9px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(3, 13, 8, .42);
}

.cf-dragon-result-hit > span {
  min-width: 0;
  overflow: hidden;
  color: #f2e2c2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-dragon-result-hit > b {
  color: #ffbd73;
  white-space: nowrap;
}

.cf-dragon-result-hit > small {
  grid-column: 1 / -1;
  color: #bff2c8;
  font-weight: 700;
}

.cf-dragon-ranking {
  display: grid;
  gap: 5px;
}

.cf-dragon-ranking > div {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(4, 14, 9, .45);
}

.cf-dragon-player {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: #ffe6a0;
  background: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-dragon-ranking > div:nth-child(1) { color: #ffe28a; }
.cf-dragon-ranking > div:nth-child(2) { color: #e4e9e6; }
.cf-dragon-ranking > div:nth-child(3) { color: #e3b082; }

.cf-dragon-place {
  font-weight: 900;
  text-align: center;
}

.cf-dragon-ranking b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-dragon-ranking-score {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
}

.cf-dragon-ranking-score b {
  color: #ffe6a0;
}

.cf-dragon-ranking-score small {
  color: #bff2c8;
  font-size: 10px;
  font-weight: 800;
}

.cf-dragon-last-seen {
  margin-bottom: 11px !important;
  color: #d5dfd3;
  text-align: center;
}

.cf-dragon-muted {
  color: #b7c6b7;
  text-align: center;
}

.cf-dragon-rules p {
  color: #cbd7ca;
  font-size: 13px;
}

.cf-dragon-loading,
.cf-dragon-error {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #cbd7ca;
  text-align: center;
}

.cf-dragon-error {
  min-height: auto;
  border-color: rgba(255, 119, 97, .45);
  color: #ffc2b7;
  background: rgba(77, 27, 23, .62);
}

.cf-dragon-monk-warning {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 196, 90, .72);
  border-radius: 13px;
  color: #fff1c2;
  background: linear-gradient(135deg, rgba(113, 42, 20, .94), rgba(55, 28, 15, .94));
  box-shadow: inset 0 1px rgba(255, 255, 255, .16), 0 4px 10px rgba(0, 0, 0, .28);
  text-align: center;
  text-shadow: 0 1px 2px #000;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .cf-dragon-scroll { padding: 8px; }
  .cf-dragon-card, .cf-dragon-result { padding: 11px; }
  .cf-dragon-personal { grid-template-columns: 1fr 1fr; }
  .cf-dragon-personal > div:last-child { grid-column: 1 / -1; }
  .cf-dragon-total-reward { align-items: flex-start; flex-direction: column; }
  .cf-dragon-total-reward b { text-align: left; }
  .cf-dragon-header { grid-template-columns: 70px 1fr 70px; }
  .cf-dragon-back { min-width: 64px; padding: 0 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-dragon-fire,
  .cf-dragon-result { animation: none; }
}
