/* ==========================================================
   Extra components and responsive tweaks
   Source: extras.css
   ========================================================== */
/*
 * extras.css
 * 用途: 追加コンテンツと配色
 * このファイル内の各セクションは、元CSSの読み込み順を維持しています。
 */

/* --------------------------------------------------------------------------
 * セクション別の背景色
 * -------------------------------------------------------------------------- */
.section-bg{
  position: relative;
  width: 100%;
  padding: 56px 0;      
  overflow: hidden;     
  isolation: isolate;   
}


.section-bg > *{
  position: relative;
  z-index: 2;
}

.section-bg + .section-bg::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(64px, 8vw, 120px);
  pointer-events: none;
  z-index: 1;
}

.section-bg--a + .section-bg--b::before,
.section-bg--c + .section-bg--b::before{
  background: linear-gradient(
    to bottom,
    #FFD5EC 0%,
    rgba(255, 213, 236, 0.72) 34%,
    rgba(255, 238, 255, 0) 100%
  );
}

.section-bg--b + .section-bg--a::before,
.section-bg--b + .section-bg--c::before{
  background: linear-gradient(
    to bottom,
    #FFEEFF 0%,
    rgba(255, 238, 255, 0.72) 34%,
    rgba(255, 213, 236, 0) 100%
  );
}


.section-bg--a{
  background-color: #FFD5EC;
}


.section-bg--b{
  background-color: #FFEEFF;
}


.section-bg--c{
  background-color: #FFD5EC;
}


@media (max-width: 768px){
  .section-bg{
    padding: 44px 0;
  }
}

/* --------------------------------------------------------------------------
 * キャラクター補助表示
 * -------------------------------------------------------------------------- */
.sg-root,
.sg-root * {
  box-sizing: border-box;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

.sg-root {
  position: relative;
  z-index: 2147483647;
}


.sg-widget {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(120px) scale(0.88);
  pointer-events: none;
}

.sg-widget.is-visible {
  pointer-events: auto;
  animation: sg-slide-up-pop 0.95s cubic-bezier(.22, 1.15, .3, 1) forwards;
}

.sg-widget.is-hidden {
  display: none;
}

@keyframes sg-slide-up-pop {
  0% {
    opacity: 0;
    transform: translateY(120px) scale(0.88);
  }
  55% {
    opacity: 1;
    transform: translateY(-8px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


.sg-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
}

.sg-icon-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.96);
  color: #2c221f;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    filter 0.25s ease,
    background-color 0.25s ease;
}

.sg-icon-btn:hover {
  transform: translateY(-2px) scale(1.06);
  filter: brightness(1.04);
  background: rgba(255, 255, 255, 1);
}

.sg-icon-btn:active {
  transform: scale(0.95);
}

.sg-icon-btn:focus-visible {
  outline: 3px solid #ff80ab;
  outline-offset: 3px;
}

.sg-icon-btn.is-muted {
  opacity: 0.72;
  background: rgba(240, 240, 240, 0.96);
}


.sg-bubble {
  position: relative;
  max-width: min(72vw, 290px);
  background: #ffffff;
  color: #2c221f;
  border: 3px solid #2c221f;
  border-radius: 22px;
  padding: 12px 16px;
  font-weight: 700;
  line-height: 1.65;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  font-size: clamp(12px, 2.1vw, 16px);
  text-align: left;
  white-space: normal;
  transition:
    transform 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease,
    box-shadow 0.35s ease;
}

.sg-bubble::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-right: 3px solid #2c221f;
  border-bottom: 3px solid #2c221f;
  transform: rotate(45deg);
}


.sg-character-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  transition:
    transform 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease;
}

.sg-character-btn:hover {
  transform: translateY(-4px) scale(1.03);
  filter: brightness(1.03) saturate(1.03);
}

.sg-character-btn:active {
  transform: scale(0.97);
}

.sg-character-btn:focus-visible {
  outline: 3px solid #ff80ab;
  outline-offset: 4px;
  border-radius: 999px;
}


.sg-character-img {
  width: clamp(96px, 20vw, 164px);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18));
  transition:
    transform 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease;
}


.sg-widget:hover .sg-bubble {
  transform: translateY(-2px);
  filter: brightness(1.02);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.14);
}

.sg-widget:hover .sg-character-img {
  transform: translateY(-2px);
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.2)) brightness(1.03);
}


.sg-mini-trigger {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2147483646;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.96);
  color: #2c221f;
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    opacity 0.25s ease;
}

.sg-mini-trigger:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.sg-mini-trigger:active {
  transform: scale(0.97);
}

.sg-mini-trigger:focus-visible {
  outline: 3px solid #ff80ab;
  outline-offset: 3px;
}

.sg-mini-trigger.is-hidden {
  display: none;
}

.sg-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff7aa8;
  flex: 0 0 auto;
}

.sg-mini-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}


@media (max-width: 768px) {
  .sg-widget {
    right: 10px;
    bottom: 10px;
    gap: 6px;
  }

  .sg-toolbar {
    gap: 6px;
  }

  .sg-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .sg-bubble {
    max-width: min(72vw, 220px);
    padding: 10px 13px;
    font-size: clamp(11px, 3.2vw, 14px);
  }

  .sg-bubble::after {
    right: 18px;
  }

  .sg-character-img {
    width: clamp(82px, 26vw, 130px);
  }

  .sg-mini-trigger {
    right: 10px;
    bottom: 10px;
    padding: 8px 11px;
  }

  .sg-mini-text {
    font-size: 11px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .sg-widget,
  .sg-bubble,
  .sg-character-btn,
  .sg-icon-btn,
  .sg-character-img,
  .sg-mini-trigger {
    animation: none !important;
    transition: none !important;
  }

  .sg-widget.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
 * オープンニュース
 * -------------------------------------------------------------------------- */
#newsOverlay{
  position: fixed;
  inset: 0;
  display: none; 

  align-items: center;
  justify-content: center;

  
  --pad-top: max(12px, env(safe-area-inset-top));
  --pad-btm: max(12px, env(safe-area-inset-bottom));
  --pad-x:   max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
  padding: var(--pad-top) var(--pad-x) var(--pad-btm);

  background: rgba(0,0,0,.88);
  z-index: 1200;

  overflow: hidden; 
}

#newsOverlay.is-open{
  display: flex;
}


.news-modal{
  position: relative;
  box-sizing: border-box;

  width: min(96vw, 1200px);
  height: min(100dvh, 100svh, 100vh);  
  max-height: 100%;                     

  background: #0b0b0b;
  color: #fff;
  border-radius: 18px;

  padding: clamp(12px, 1.8vw, 18px);
  box-shadow: 0 10px 40px rgba(0,0,0,.6);

  outline: none;
  overflow: hidden; 

  animation: overlay-in .35s ease-out both;
}

@keyframes overlay-in{
  from{ transform: translateY(12px); opacity:0 }
  to  { transform: translateY(0);   opacity:1 }
}


.news-layout{
  height: 100%;
  min-height: 0;

  display: grid;
  grid-template-columns: 1fr clamp(260px, 34vw, 480px);
  grid-template-areas: "text media";
  gap: clamp(10px, 2vw, 18px);

  align-items: center; 
}

.news-text{
  grid-area: text;

  
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(6px, 1vw, 12px);
  align-content: center; 

  text-align: left; 
}

.news-media{
  grid-area: media;

  min-height: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  padding: 10px;

  display: grid;
  place-items: center;
}


.news-title{
  margin: 0;
  font-weight: 700;
  letter-spacing: .02em;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.25;
}


.news-lead{
  margin: 0;
  opacity: .9;
  line-height: 1.55;
  font-size: clamp(14px, 1.8vw, 18px);
  text-align: right;  
}


.news-body{
  margin: 0;
  min-height: 0;

  line-height: 1.75;
  font-size: clamp(14px, 1.7vw, 18px);

  overflow: auto;           
  padding-right: 10px;      
  scrollbar-gutter: stable; 

  
  max-height: 100%;
}


.news-body p{
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}


.news-illustration{
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;

  object-fit: contain; 
  border-radius: 12px;
  display: block;
}


.news-close{
  
  appearance: none;
  -webkit-appearance: none;

  border: none;
  cursor: pointer;

  
  position: absolute;
  top:  calc(10px + env(safe-area-inset-top));
  left: calc(10px + env(safe-area-inset-left));
  right: auto;                 

  
  width: 42px;
  height: 42px;
  border-radius: 999px;

  
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 22px;
  line-height: 1;

  
  display: grid;
  place-items: center;

  
  z-index: 5;
}

.news-close:hover{
  background: rgba(255,255,255,.16);
}



html.is-locked,
body.is-locked{
  overflow: hidden !important;
}


@media (max-width: 768px){
  .news-modal{
    width: min(96vw, 720px);
    padding: 12px;
  }

  .news-layout{
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto; 
    grid-template-areas:
      "media"
      "text";
    gap: 10px;
    align-items: stretch;
  }

  
  .news-text{
    align-content: start;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
  }

  .news-title{
    font-size: clamp(18px, 5vw, 24px);
  }

  .news-lead{
    font-size: clamp(13px, 3.6vw, 16px);
    text-align: right; 
  }

  .news-body{
    font-size: clamp(13px, 3.6vw, 16px);
    
    padding-right: 8px;
  }

  .news-media{
    padding: 8px;
  }
}


@media (max-height: 700px){
  .news-modal{ padding: 10px; }
  .news-layout{ gap: 10px; }
}
