/* ローカル上書き */
body.sidebar-open,
body.opensidebar { overflow: hidden; }

#preloader { position: fixed; inset: 0; background: #fff; z-index: 99999; display: flex; align-items: center; justify-content: center; }

/* ===== ヘッダー追従 ===== */
#app-header {
  position: sticky;
  top: 0;
  z-index: 1050;
}

header,
header.cus-header {
  position: sticky !important;
  top: 0;
  z-index: 1050;
  width: 100%;
}

body.set-bg-image header {
  position: sticky !important;
  top: 0;
  z-index: 1050;
}

header.cus-header {
  background-color: #111339;
  background-image: url(../backend/img/headerBg.png);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  padding: 12px 0;
}

header {
  background-image: url(../backend/img/headerBg.png);
  background-position: center center;
}

header .container {
  position: relative;
  z-index: 1;
}

/* ===== フッター ===== */
body.has-bottom-nav footer.innerFooter {
  position: static;
}

footer.innerFooter {
  padding: 16px 16px 12px;
  margin-top: 24px;
}

footer.innerFooter .footerBox .menuBox ul li:not(:last-child) {
  margin-bottom: 0;
}

footer.innerFooter .footerBox .menuBox ul li a {
  font-size: 15px;
}

footer.innerFooter .footerBox .copyright {
  padding-top: 10px;
  margin-top: 0;
}

footer.innerFooter .footerBox .copyright p,
footer.innerFooter .footerBox .copyright p span {
  font-size: 14px;
}

/* ===== ボトムナビ ===== */
body.has-bottom-nav {
  padding-bottom: 80px;
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid #f1f1f1;
  background: #fff;
  height: 80px;
  padding: 10px 20px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
}

.bottomnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 540px;
  margin: 0 auto;
}

.bottomnav .items {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  flex: 1;
}

.bottomnav .items a {
  color: rgba(0, 0, 0, 0.54);
  font-size: 11px;
  text-decoration: none;
  display: block;
}

.bottomnav .items.active a {
  color: rgba(0, 0, 0, 0.87);
}

.bottomnav .items .img {
  width: 24px;
  height: 24px;
  margin: 0 auto 5px;
}

.bottomnav .items .img img {
  width: 24px;
  height: 24px;
  display: block;
}

.bottomnav .items span {
  display: block;
  text-align: center;
}

.grid .items .item-content .btn-default {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(0deg, rgba(175,175,175,1) 0%, rgba(42,42,42,1) 30%, rgba(42,42,42,1) 50%, rgba(42,42,42,1) 70%, rgba(175,175,175,1) 100%);
  border: 0; color: #fff; font-weight: 700; border-radius: 8px;
}

.history-empty { text-align: center; padding: 40px 20px; color: #888; }
.test-hint { margin-top: 16px; padding: 12px; background: #f5f5f5; border: 1px dashed #ccc; font-size: 12px; text-align: center; color: #666; }

.history-card-image {
  width: 92px;
  height: 124px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.history-item-card {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  height: 100%;
  background: #fff;
  text-align: center;
}

.history-item-card {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.history-item-card.is-selected {
  border-color: #111339;
  box-shadow: 0 0 0 2px rgba(17, 19, 57, 0.12);
  background: #f8f9ff;
}

.history-item-card.is-shipping-only {
  opacity: 0.92;
}

.history-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.history-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.history-action-bar .btn-primary.btn-sm {
  font-weight: 700;
  border-radius: 8px;
  border: 0;
  padding: 10px 16px;
}

.gacha-result-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 132px;
  min-height: 168px;
  margin: 4px;
  padding: 10px;
  vertical-align: top;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.gacha-result-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.gacha-result-card img {
  width: 72px;
  height: 96px;
  margin-bottom: 6px;
  object-fit: cover;
  border-radius: 6px;
}

.gacha-result-card span,
.gacha-result-card small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.gacha-result-card span {
  font-size: 12px;
  font-weight: 700;
}

.gacha-result-card small {
  color: #6b7280;
  font-size: 11px;
}

/* ===== レスポンシブ基盤 ===== */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-width: 0;
}

img,
video,
svg {
  max-width: 100%;
}

.static-content img,
#detailContent img,
.owl-carousel .item img,
header .logo img {
  height: auto;
}

/* モバイルのみコンテナ全幅 */
@media (max-width: 991px) {
  .container,
  .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (min-width: 992px) {
  .container-fluid {
    max-width: 1054px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
  }

  .carousel-div {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===== ヘッダー ===== */
header .logo img,
header .headercart .star img,
.landing .item-content .pricetag .price img,
.grid .item-content .pricetag .price img {
  background-color: transparent;
}

header .headercart .star img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 767px) {
  header .logo img {
    max-width: 100px;
    height: auto;
  }

  header .headerright {
    width: calc(100% - 100px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  header .headercart .text {
    font-size: 12px;
    white-space: nowrap;
  }

  header .login-link.login_btn {
    font-size: 12px;
    padding: 4px 8px;
    white-space: nowrap;
  }

  header.cus-header .pagetitle {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 72px);
  }
}

/* ===== サイドバー ===== */
@media (max-width: 575px) {
  .sidebar-portal-content {
    width: 100% !important;
    right: -100% !important;
  }

  body.opensidebar .sidebar-portal-content {
    right: 0 !important;
  }
}

/* ===== 商品グリッド ===== */
.grid,
.grid.landing {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.grid.landing .row {
  margin-left: -8px;
  margin-right: -8px;
}

.grid.landing .series-item {
  padding-left: 8px;
  padding-right: 8px;
}

.grid.landing .items .bgimg {
  position: relative;
}

.grid.landing .items .bgimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.change-order.pull-right {
  max-width: 100%;
}

@media (max-width: 575px) {
  .change-order.pull-right {
    float: none !important;
    display: block;
    width: 100%;
    margin-bottom: 12px;
  }

  .landing .series-manage-height,
  .landing .items.btnSpin-100card {
    height: auto !important;
    min-height: 340px;
  }

  .landing .items .bgimg {
    height: 200px;
  }

  .grid .item-content .btn-box .btn {
    font-size: 12px;
    padding: 10px 8px;
  }

  .landing .item-content .pricetag .price span,
  .landing .item-content .pricetag .price2 .valuetext {
    font-size: 16px !important;
  }
}

/* ===== カルーセル ===== */
.owl-carousel .item img {
  max-width: 100%;
  width: auto;
  margin: 0 auto;
}

.news-carousel-section {
  padding-top: 20px;
  padding-bottom: 6px;
  max-width: none;
}

.news-carousel-section .carousel-div {
  display: block;
  position: relative;
  max-width: none;
  margin: 0 auto;
}

.news-banner-carousel .item a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.news-banner-carousel.owl-carousel .owl-item .item img {
  display: block;
  width: 100% !important;
  max-width: 520px;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border: transparent;
  border-radius: 10px;
}

.news-carousel-section .owl-theme .owl-nav {
  margin-top: 0;
}

.news-carousel-section .owl-theme .owl-nav .owl-prev,
.news-carousel-section .owl-theme .owl-nav .owl-next {
  position: absolute;
  top: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 35px;
  margin: 0;
  padding: 4px 3px;
  transform: none;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
}

.news-carousel-section .owl-theme .owl-nav .owl-prev {
  left: 8px;
  bottom: 138px;
}

.news-carousel-section .owl-theme .owl-nav .owl-next {
  right: 8px;
  bottom: 138px;
}

.news-carousel-section .owl-theme .owl-nav .owl-prev i,
.news-carousel-section .owl-theme .owl-nav .owl-next i {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.news-carousel-section .owl-theme .owl-dots {
  margin-top: 6px;
  line-height: 1;
}

.news-carousel-section .owl-theme .owl-dots .owl-dot span {
  width: 6px;
  height: 6px;
  margin: 0 5px;
  background: #b8b8b8;
}

.news-carousel-section .owl-theme .owl-dots .owl-dot.active span {
  background: #ce3256;
}

@media (max-width: 575px) {
  .owl-carousel .item img {
    max-height: 180px;
  }

  .carousel-div {
    margin-top: 12px;
  }

  .news-banner-carousel .item a {
    min-height: auto;
  }

  .news-banner-carousel.owl-carousel .owl-item .item img {
    width: 100% !important;
    max-width: 520px;
    height: auto;
    aspect-ratio: auto;
  }

  .news-carousel-section .owl-theme .owl-nav .owl-prev {
    left: 11px;
    bottom: 125px;
    transform: translateX(-50%);
  }

  .news-carousel-section .owl-theme .owl-nav .owl-next {
    right: 11px;
    bottom: 125px;
    transform: translateX(50%);
  }
}

/* ===== お知らせ ===== */
.news_section .news_list {
  overflow: hidden;
}

.news_section .news_text a {
  display: block;
}

.news_section .news_text h6,
.news_section .news_text p {
  font-size: clamp(12px, 3.5vw, 14px);
}

/* ===== フッターリンク ===== */
footer.innerFooter .menuBox ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding-left: 0;
  list-style: none;
}

@media (max-width: 575px) {
  footer.innerFooter .menuBox ul {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ===== ログイン・登録 ===== */
body.has-register-banner {
  padding-bottom: 76px;
}

@media (max-width: 575px) {
  .register-banner-fixed {
    flex-direction: column !important;
    gap: 10px;
    text-align: center;
    padding: 12px 16px !important;
  }

  .register-banner-fixed .btn {
    width: 100%;
  }

  .loginform .title {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .form .btn {
    max-width: 100%;
  }
}

/* ===== ポイント購入 ===== */
@media (max-width: 575px) {
  .point-grid .items {
    flex-wrap: wrap;
    padding: 16px;
    gap: 12px;
  }

  .point-grid .items .img {
    width: 40px;
    height: 40px;
    margin-right: 12px;
  }

  .point-grid .items .text {
    width: calc(100% - 52px);
    flex: 1 1 calc(100% - 52px);
  }

  .point-grid .items .text .item-name span {
    font-size: 18px !important;
  }

  .point-grid .items .action {
    width: 100%;
    text-align: center;
  }

  .point-grid .items .action .btn {
    width: 100%;
  }
}

/* ===== 獲得商品 ===== */
.main-container.historypage {
  background-image: url(../assets/images/gacha-result-background.png);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

@media (max-width: 575px) {
  .historypage .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .historypage .nav-tabs .nav-link {
    font-size: 13px;
    white-space: nowrap;
    padding: 8px 12px;
  }

  .historypage .d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ===== マイページ ===== */
.main-container .table {
  width: 100%;
}

.main-container .table td {
  word-break: break-word;
}

.main-container .table td a {
  display: block;
}

/* ===== 静的ページ ===== */
.static-content {
  overflow-wrap: break-word;
  word-break: break-word;
}

.static-content img,
.static-content table {
  max-width: 100%;
  height: auto;
}

.static-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#terms .termsBox,
.static-content .termsBox {
  padding: 30px 16px;
}

@media (max-width: 575px) {
  #terms .termsBox,
  .static-content .termsBox {
    padding: 20px 10px;
  }

  #terms .termsBox h3,
  .static-content h3 {
    font-size: 1.25rem;
  }
}

/* ===== 商品詳細 ===== */
#detailContent .btn {
  margin-bottom: 8px;
}

.detail-page {
  max-width: 1040px;
  margin: 0 auto;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.detail-image-wrap {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.detail-main-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.detail-soldout {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-size: clamp(28px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: 0;
}

.detail-buy-panel,
.detail-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.detail-buy-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}

.detail-status {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 4px 10px;
  color: #065f46;
  background: #d1fae5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.detail-status.is-soldout {
  color: #991b1b;
  background: #fee2e2;
}

.detail-buy-panel h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.25;
}

.detail-price-row,
.detail-user-points,
.detail-stock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.detail-price-row {
  padding: 14px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.detail-price-row span,
.detail-user-points span,
.detail-stock-head span,
.detail-muted {
  color: #64748b;
  font-size: 13px;
}

.detail-price-row strong {
  font-size: 30px;
  line-height: 1;
}

.detail-stock {
  display: grid;
  gap: 8px;
}

.detail-stock-bar {
  height: 10px;
  overflow: hidden;
  background: #e5e7eb;
  border-radius: 999px;
}

.detail-stock-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ce3256 0%, #f97316 50%, #16a34a 100%);
  border-radius: inherit;
}

.detail-actions {
  display: grid;
  gap: 10px;
}

.detail-spin-button,
.detail-point-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff !important;
  background: linear-gradient(180deg, #ef476f 0%, #c9184a 100%);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(206, 50, 86, 0.24);
}

.detail-spin-button.secondary {
  background: linear-gradient(180deg, #111827 0%, #374151 100%);
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
}

.detail-spin-button.accent {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 10px 20px rgba(217, 119, 6, 0.22);
}

.detail-spin-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

.detail-point-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.detail-section {
  margin-top: 18px;
}

.detail-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-section-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.detail-section-heading p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.detail-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.detail-tier-chip {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.detail-tier-chip strong {
  font-size: 13px;
}

.detail-tier-chip span {
  color: #ce3256;
  font-size: 18px;
  font-weight: 900;
}

.detail-tier-chip small {
  color: #64748b;
  font-size: 12px;
}

.detail-prize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-prize-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.detail-prize-card img {
  width: 48px;
  height: 64px !important;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.detail-prize-card strong,
.detail-prize-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-prize-card strong {
  font-size: 13px;
}

.detail-prize-card small {
  color: #64748b;
  font-size: 12px;
}

.detail-prize-tier {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 7px;
  color: #fff;
  background: #ce3256;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 575px) {
  #detailContent .btn {
    display: block;
    width: 100%;
    margin-right: 0 !important;
    margin-bottom: 10px;
  }
}

@media (max-width: 767px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-buy-panel {
    position: static;
  }

  .detail-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-prize-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== モーダル ===== */
@media (max-width: 575px) {
  .modal-dialog {
    margin: 12px auto;
    max-width: calc(100% - 24px);
  }

  .modal-dialog.modal-lg {
    max-width: calc(100% - 24px);
  }
}

/* ===== サイドメニュー ===== */
.sidebar-account {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8ecf1;
}

.sidebar-account-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.sidebar-account-username {
  font-size: 18px;
  font-weight: 700;
  color: #111339;
  word-break: break-all;
}
