
.fixed__banner {
  --banner-red: #f65757;
  --banner-yellow: #fff500;
  --banner-gray: #646464;

  box-sizing: border-box;
  width: fit-content;
  max-width: calc(100vw - 24px);
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 99;

  padding: 5px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 3px 3px 15px 1px rgba(0, 0, 0, 0.25);

  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease;
}

.fixed__banner,
.fixed__banner * {
  box-sizing: border-box;
}

.fixed__banner:hover {
  opacity: 0.9;
}

.fixed__banner.invisible {
  opacity: 0;
  pointer-events: none;
}

/* 閉じるボタン */
.fixed__banner .fixed__banner--cross {
  width: 36px;
  height: 36px;
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 2;

  background: #fff;
  border: 2px solid #777;
  border-radius: 50%;
}

.fixed__banner .fixed__banner--cross::before,
.fixed__banner .fixed__banner--cross::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #777;
  border-radius: 2px;
}

.fixed__banner .fixed__banner--cross::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.fixed__banner .fixed__banner--cross::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* タイトル */
.fixed__banner .fixed__banner-title {
  position: relative;
  z-index: 1;
  margin: 0 8px;
  color: var(--banner-gray);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.fixed__banner .fixed__banner-title b {
  color: var(--banner-red);
  font-weight: 700;
}

.fixed__banner .fixed__banner-title b .fixed__banner-title--big {
  font-size: 48px;
}

.fixed__banner .fixed__banner-title .underbar {
  display: block;
  position: absolute;
  bottom: 3px;
  z-index: -1;
  width: 100%;
  height: 10px;
  background: var(--banner-yellow);
}

/* メイン部分 */
.fixed__banner .fixed__banner-body {
  padding: 5px 10px;
  background: var(--banner-red);
  border-radius: 0 0 21px 21px;
}

.fixed__banner .fixed__banner-content {
  margin: 0;
  padding: 10px 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-align: center;
}

.fixed__banner .fixed__banner-content span {
  color: var(--banner-yellow);
}

/* 下部のボタン風エリア */
.fixed__banner .fixed__banner--bottom {
  position: relative;
  width: 95%;
  margin: 0 auto;
  padding: 5px 18px 5px 5px;

  background: #fff;
  border-radius: 12px;
  color: var(--banner-red);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.fixed__banner .fixed__banner--bottom::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 10px;
  height: 12px;
  background: var(--banner-red);
  clip-path: polygon(0 0, 0 100%, 100% 50%);
  transform: translateY(-50%);
}

.fixed__banner .fixed__banner-caption {
  display: inline-block;
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
}

/* タブレット・スマートフォン */
@media (max-width: 768px) {
  .fixed__banner {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: min(250px, calc(100vw - 24px));
    padding: 4px;
    border-radius: 17px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.22);
  }

  .fixed__banner .fixed__banner--cross {
    width: 30px;
    height: 30px;
    top: -8px;
    right: -8px;
  }

  .fixed__banner .fixed__banner--cross::before,
  .fixed__banner .fixed__banner--cross::after {
    width: 15px;
    height: 2px;
  }

  .fixed__banner .fixed__banner-title {
    margin: 0 5px;
    font-size: 15.5px;
    line-height: 1.15;
  }

  .fixed__banner .fixed__banner-title b .fixed__banner-title--big {
    font-size: 32px;
  }

  .fixed__banner .fixed__banner-title .underbar {
    bottom: 2px;
    height: 7px;
  }

  .fixed__banner .fixed__banner-body {
    padding: 4px 6px;
    border-radius: 0 0 14px 14px;
  }

  .fixed__banner .fixed__banner-content {
    padding: 7px 0;
    font-size: clamp(16px, 4.5vw, 21px);
    line-height: 1.15;
    letter-spacing: 0.02em;
  }

  .fixed__banner .fixed__banner--bottom {
    padding: 5px 17px 5px 4px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.25;
  }

  .fixed__banner .fixed__banner--bottom::before {
    right: 7px;
    width: 8px;
    height: 10px;
  }

  .fixed__banner .fixed__banner-caption {
    font-size: 9px;
    line-height: 1.5;
    margin-top: 5px;
  }
}

/* 小型スマートフォン */
@media (max-width: 380px) {
  .fixed__banner {
    max-width: min(240px, calc(100vw - 20px));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .fixed__banner .fixed__banner-title {
    font-size: 15px;
  }

  .fixed__banner .fixed__banner-title b .fixed__banner-title--big {
    font-size: 28px;
  }

  .fixed__banner .fixed__banner-content {
    font-size: 16px;
  }

  .fixed__banner .fixed__banner--bottom {
    font-size: 12px;
  }
}

/* 動きを抑える設定を尊重 */
@media (prefers-reduced-motion: reduce) {
  .fixed__banner {
    transition: none;
  }
}
