.freefbt-math-gate {
  margin-top: 12px;
}

.freefbt-admin-shortcut {
  position: fixed;
  top: 112px;
  left: 168px;
  z-index: 1700;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #13b7c9;
  border-radius: 6px;
  background: rgba(18, 28, 33, 0.94);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

.freefbt-admin-shortcut:hover,
.freefbt-admin-shortcut:focus {
  color: #fff;
  text-decoration: none;
  background: #0b5660;
}

.freefbt-side-ads {
  position: fixed;
  top: 104px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 146px;
  pointer-events: none;
}

.freefbt-side-ads-left {
  left: 8px;
}

.freefbt-side-ads-right {
  right: 8px;
}

.freefbt-side-ads a {
  display: block;
  height: 248px;
  overflow: hidden;
  pointer-events: auto;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  animation: freefbtAdIn 520ms ease forwards;
}

.freefbt-side-ads a.is-loaded {
  opacity: 1;
}

.freefbt-side-ads img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes freefbtAdIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.freefbt-chat {
  position: fixed;
  left: 16px;
  bottom: 0;
  z-index: 2147483000;
  width: 340px;
  overflow: hidden;
  background: #f5f7f8;
  border: 1px solid #1a6d7a;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
  color: #111;
}

.freefbt-chat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  background: #314e5c;
}

.freefbt-chat-toggle,
.freefbt-chat-actions button {
  border: 0;
  background: transparent;
  color: #fff;
}

.freefbt-chat-toggle {
  flex: 1;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}

.freefbt-chat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
}

.freefbt-chat-actions button {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.freefbt-chat-actions button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.freefbt-chat.is-collapsed .freefbt-chat-body {
  display: none;
}

.freefbt-chat-body {
  background: #f5f7f8;
}

.freefbt-chat-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid #d7dee2;
  background: #eef3f5;
  color: #222;
  font-size: 12px;
  font-weight: 700;
}

.freefbt-chat-tools label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.freefbt-chat-tools input[type="color"] {
  width: 34px;
  height: 24px;
  padding: 0;
  border: 1px solid #aebbc3;
  background: #fff;
}

.freefbt-chat-messages {
  height: 250px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  color: #111;
  font-size: 13px;
}

.freefbt-chat-line {
  margin-bottom: 7px;
  overflow-wrap: anywhere;
}

.freefbt-chat-line strong {
  color: #111;
}

.freefbt-chat-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 4px;
  color: #000;
  background: #fff;
}

.freefbt-chat-form {
  display: flex;
  border-top: 1px solid #d7dee2;
  background: #fff;
}

.freefbt-chat-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px;
  color: #000;
  background: #fff;
}

.freefbt-chat-form button,
.freefbt-profile-poke-row button {
  border: 0;
}

.freefbt-chat-form button {
  min-width: 64px;
  background: #0f8fa4;
  color: #fff;
  font-weight: 700;
}

.freefbt-popout-shell {
  max-width: 520px;
  margin: 18px auto;
}

.freefbt-popout-title {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 700;
}

.freefbt-chat.is-popout {
  position: static;
  width: 100%;
  min-height: 480px;
  border-radius: 7px;
}

.freefbt-chat.is-popout .freefbt-chat-messages {
  height: min(360px, calc(100vh - 210px));
}

.freefbt-scoreboard-panel .panel-heading {
  font-weight: 700;
}

.freefbt-scoreboard-panel ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.freefbt-scoreboard-panel li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.freefbt-scoreboard-panel li:last-child {
  border-bottom: 0;
}

.freefbt-scoreboard-panel b {
  color: #13b7c9;
}

.freefbt-profile-badge-panel .panel-body {
  padding: 10px;
}

.freefbt-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.freefbt-badge-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  aspect-ratio: 1 / 1;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(19, 183, 201, 0.85);
  border-radius: 6px;
  background: linear-gradient(180deg, #262626, #181818);
  color: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.freefbt-badge-tile img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.freefbt-badge-tile b {
  display: block;
  width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.freefbt-badge-tile em {
  position: absolute;
  top: 5px;
  right: 6px;
  color: #ffd866;
  font-style: normal;
  font-weight: 700;
}

.freefbt-trophy {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f2c94c;
  color: #222;
  font-weight: 900;
}

.freefbt-empty-badges {
  padding: 10px;
  border: 1px dashed rgba(19, 183, 201, 0.55);
  border-radius: 6px;
  color: inherit;
  text-align: center;
}

.freefbt-profile-poke-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}

.freefbt-post-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.freefbt-post-badge {
  display: inline-flex;
  align-items: center;
  max-width: 140px;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid #13b7c9;
  border-radius: 5px;
  background: rgba(19, 183, 201, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.freefbt-post-badge img,
.freefbt-post-badge span {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.freefbt-post-badge b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .freefbt-side-ads {
    display: none;
  }

  .freefbt-admin-shortcut {
    top: auto;
    left: 12px;
    bottom: 44px;
  }
}

@media (max-width: 520px) {
  .freefbt-chat {
    left: 0;
    right: 0;
    width: auto;
  }

  .freefbt-admin-shortcut {
    display: none;
  }
}
