/* 趣味登録バナー + 登録ログ（共通UI） */

.shumi-feed-banner {
  position: fixed;
  top: 45px;
  left: 0;
  right: 0;
  z-index: 400;
  height: 34px;
  overflow: hidden;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.88);
  border-bottom: 1px solid #a07231;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.shumi-feed-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.shumi-feed-banner__track {
  display: inline-block;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  animation: shumi-feed-marquee var(--marquee-duration, 40s) linear forwards;
  color: #f5f1e8;
  font-family: var(--font-maruko, "MRT Marukoias Beta", "Noto Sans JP", sans-serif);
  font-size: 14px;
  line-height: 34px;
}

.shumi-feed-banner__track span {
  display: inline-block;
}

@keyframes shumi-feed-marquee {
  from {
    transform: translateX(var(--marquee-from, 100%));
  }
  to {
    transform: translateX(var(--marquee-to, -100%));
  }
}

.shumi-log {
  position: fixed;
  z-index: var(--shumi-log-z, 100);
  left: 16px;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100vw - 24px));
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  font-family: var(--font-maruko, "MRT Marukoias Beta", "Noto Sans JP", sans-serif);
  color: #f5f1e8;
}

.shumi-log__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  max-width: min(360px, calc(100vw - 24px));
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #a07231;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.92);
  color: #f5f1e8;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shumi-log__toggle:hover {
  filter: brightness(1.08);
}

.shumi-log__panel {
  display: none;
  margin: 0;
  max-height: min(45vh, 420px);
  width: 100%;
  overflow: auto;
  border: 1px solid #a07231;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.shumi-log.is-open .shumi-log__panel {
  display: block;
}

.shumi-log__head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(160, 114, 49, 0.55);
  background: rgba(0, 0, 0, 0.96);
}

.shumi-log__title {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.shumi-log__hint {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(245, 241, 232, 0.72);
}

.shumi-log__body {
  padding: 8px 10px 12px;
}

.shumi-log__status {
  margin: 0;
  padding: 12px 4px;
  font-size: 12px;
  color: rgba(245, 241, 232, 0.7);
}

.shumi-log__item {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shumi-log__item:last-child {
  border-bottom: 0;
}

.shumi-log__meta {
  margin: 0 0 4px;
  font-size: 11px;
  color: rgba(245, 241, 232, 0.7);
}

.shumi-log__name {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.3;
}

.shumi-log__weights,
.shumi-log__reactions {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(245, 241, 232, 0.88);
}

@media (max-width: 1024px) {
  .shumi-log {
    left: 16px;
    bottom: 16px;
  }

  .shumi-log__toggle {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

@media (max-width: 599px) {
  .shumi-feed-banner {
    top: 56px;
    height: 32px;
  }

  .shumi-feed-banner__track {
    font-size: 12px;
    line-height: 32px;
  }

  .shumi-log {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    align-items: stretch;
  }

  .shumi-log__toggle {
    width: 100%;
    max-width: none;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 13px;
    justify-content: center;
  }

  .shumi-log__panel {
    max-height: min(50vh, 380px);
  }

  body {
    /* Fixed hobby-log bar + safe area + breathing room so content isn't covered */
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .shumi-feed-banner__track {
    animation: none;
    padding: 0 12px;
    transform: none;
  }
}
