/* ========================================
   standby/style.css
   待機画面専用スタイル
======================================== */

/* 背景 */
.standby-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
}

.standby-bg video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease;
}

.standby-bg__fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b2f4a 0%, #1a1a24 100%);
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 0;
}

.standby-bg__fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
}

.standby-bg__fallback.is-hidden {
  opacity: 0;
  visibility: hidden;
}

/* フェード用オーバーレイ */
.standby-fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.65));
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 5;
}

/* ========================================
   7インチタブレット用レイアウト（デフォルト）
======================================== */

/* メインコンテンツ */
.standby-content {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  pointer-events: auto; /* 初期状態では画面全体がタッチ可能 */
}

/* アクティベーション後は子要素のみタッチ可能 */
.standby-content.is-activated {
  pointer-events: none;
}

.standby-content.is-activated > * {
  pointer-events: auto;
}

.standby-content > * {
  position: relative;
  z-index: 11;
  flex-shrink: 0;
}

/* 操作エリア（中央） */
.standby-operation-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 600px;
  flex-grow: 1;
}

/* 施設名（中央上部） */
.standby-facility-name {
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  opacity: 1;
  visibility: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.standby-facility-name__logo-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  display: inline-block;
}

.standby-facility-name__logo-wrapper::before {
  content: '';
  position: absolute;
  top: 85%;
  left: 10%;
  width: 80%;
  height: 60%;
  z-index: -1;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.01);
  border-radius: 50%;
}

.standby-facility-name__logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 1 / 1;
  display: block;
}

.standby-facility-name__title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #f5f5f5;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.05em;
  margin: 0;
  white-space: nowrap;
}

.standby-facility-name__subtitle {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(13px, 2.5vw, 22px);
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
  color: #f5f5f5;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.03em;
  margin: 8px 0 0 0;
  white-space: nowrap;
}

/* 選択ボタン - 初期状態では非表示 */
.standby-buttons {
  position: relative;
  margin: 0;
  flex-shrink: 0;
  z-index: 200;
  width: 100%;
  max-width: 650px;
  height: 550px; /* ボタンが斜めに配置できる十分な高さ（ボタンサイズ拡大に対応） */
}

/* タッチ後に表示（JavaScriptで制御） */
.standby-content.is-activated .standby-buttons {
  /* JavaScriptで個別にアニメーション制御 */
}

.standby-button {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: all 0.3s ease;
  position: absolute;
  overflow: visible;
  width: 300px !important;
  height: 300px !important;
  min-width: 300px !important;
  min-height: 300px !important;
  font-size: 30px !important;
  padding: 28px !important;
  z-index: 201;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  pointer-events: none;
  /* ボタン本体は透明に */
  background: transparent !important;
  border: none !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  cursor: pointer;
}

/* 揺れる背景レイヤー（ワイン・ビールボタン用） */
.standby-button::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  /* グラスモーフィズム効果 */
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  /* 影と光の効果 */
  box-shadow: 0 0 20px rgba(111, 43, 36, 0.3), 0 0 40px rgba(111, 43, 36, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
  animation: breathing-glow-glass 2.5s ease-in-out infinite !important;
  /* 液体の揺れエフェクトは背景レイヤーにのみ適用 */
  filter: url(#liquidWaveFilter) !important;
}

/* 2重線の内側の円（疑似要素で実装） */
.standby-button::after {
  content: "" !important;
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  animation: breathing-inner-border 2.5s ease-in-out infinite !important;
  /* 液体の揺れエフェクトを内側の円にも適用 */
  filter: url(#liquidWaveFilter) !important;
}

/* ワインボタンを左上に配置 */
.standby-button[data-type="wine"] {
  top: 0;
  left: 0;
}

/* ビールボタンを右下に配置 */
.standby-button[data-type="beer"] {
  bottom: 0;
  right: 0;
}

/* ボタンがアクティブになったときのスタイル */
.standby-button.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out,
    transform 0.8s ease-in-out;
}

/* ホバー時の反応（タッチボタンと同じ） */
.standby-button:hover {
  transform: scale(1.05) !important;
}

.standby-button:hover::before {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* アクティブ時の反応（タッチボタンと同じ） */
.standby-button:active {
  transform: scale(0.98) !important;
}

.standby-button svg {
  position: relative;
  z-index: 10;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  fill: currentColor;
}

.standby-button span {
  position: relative;
  z-index: 10;
  font-weight: 700;
  font-family: "Noto Serif JP", serif;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* タッチ誘導ボタン - 画面中央より少し下に表示 */
.signage-container .standby-touch-prompt {
  text-align: center;
  position: fixed !important;
  top: 58% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 300 !important;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out,
    transform 0.5s ease-in-out !important;
  width: auto !important;
  padding: 0 !important;
}

/* タッチ後は非表示（0.5秒でフェードアウト） */
.standby-content.is-activated .standby-touch-prompt {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translate(-50%, -50%) scale(1.2) !important;
  pointer-events: none !important;
}

/* 正円形タッチボタン（グラスモーフィズムデザイン + 2重線） */
.signage-container .standby-touch-button {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 300px !important;
  height: 300px !important;
  border-radius: 50% !important;
  border: none !important;
  outline: none !important;
  cursor: pointer !important;
  overflow: visible !important;
  padding: 28px !important;
  background: transparent !important;
  transition: transform 0.2s ease-out !important;
}

/* 揺れる背景レイヤー（疑似要素で実装） */
.signage-container .standby-touch-button::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  /* グラスモーフィズム効果 */
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  /* 影と光の効果 */
  box-shadow: 0 0 20px rgba(111, 43, 36, 0.3), 0 0 40px rgba(111, 43, 36, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
  animation: breathing-glow-glass 2.5s ease-in-out infinite !important;
  /* 液体の揺れエフェクトは背景レイヤーにのみ適用 */
  filter: url(#liquidWaveFilter) !important;
}

/* 2重線の内側の円（box-shadowで実装） */
.signage-container .standby-touch-button::after {
  content: "" !important;
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  animation: breathing-inner-border 2.5s ease-in-out infinite !important;
  filter: url(#liquidWaveFilter) !important;
}

/* ホバー時の反応 */
.signage-container .standby-touch-button:hover {
  transform: scale(1.05) !important;
}

.signage-container .standby-touch-button:hover::before {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* アクティブ時の反応 */
.signage-container .standby-touch-button:active {
  transform: scale(0.98) !important;
}

/* ボタンラベル */
.signage-container .standby-touch-button__label {
  position: relative !important;
  z-index: 2 !important;
  font-family: "Noto Serif JP", serif !important;
  font-size: 30px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  letter-spacing: 0.08em !important;
  user-select: none !important;
  text-align: center !important;
  line-height: 1.5 !important;
  animation: label-glow 2.5s ease-in-out infinite !important;
}

/* グロウエフェクト用要素 */
.signage-container .standby-touch-button__glow {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  border-radius: 50% !important;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  ) !important;
  opacity: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  transform: scale(0.8) !important;
}

/* 呼吸アニメーション（グラスモーフィズム版：光の輪郭が滲む） */
@keyframes breathing-glow-glass {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(111, 43, 36, 0.3), 0 0 40px rgba(111, 43, 36, 0.2),
      0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow: 0 0 40px rgba(111, 43, 36, 0.5), 0 0 60px rgba(184, 112, 100, 0.4),
      0 0 80px rgba(231, 196, 179, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3),
      inset 0 0 30px rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
  }
}

/* 内側の円のアニメーション（外側と同期） */
@keyframes breathing-inner-border {
  0%,
  100% {
    border-color: rgba(255, 255, 255, 0.25);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.45);
  }
}

/* ラベルの光るアニメーション（呼吸アニメーションと同期） */
@keyframes label-glow {
  0%,
  100% {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  50% {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3),
      0 0 15px rgba(255, 255, 255, 0.7), 0 0 25px rgba(255, 255, 255, 0.4);
  }
}

/* 液体の揺れエフェクト用SVGフィルター（非表示） */
.liquid-wave-filter {
  position: absolute;
  width: 0;
  height: 0;
  visibility: hidden;
}

/* ========================================
   動画切り替え用フェードエフェクト
======================================== */

/* 動画のクロスフェード用スタイル */
.signage-bg__video {
  transition: opacity 0.8s ease-in-out;
}

.signage-bg__video.fade-out {
  opacity: 0;
}

/* ========================================
   55インチ縦型ディスプレイ用レイアウト
======================================== */

@media (min-height: 1500px) {
  /* 背景動画を左側にも表示 */
  .standby-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 35%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3), transparent);
    z-index: 1;
    pointer-events: none;
  }

  /* メインコンテンツを左右分割 */
  .standby-content {
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
  }

  /* 施設名のサイズを拡大（55インチ用） */
  .standby-facility-name {
    top: 6%;
    gap: 16px;
  }

  .standby-facility-name__logo-wrapper {
    width: 200px;
    height: 200px;
  }

  .standby-facility-name__logo-wrapper::before {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .standby-facility-name__title {
    font-size: clamp(38px, 3vw, 52px);
    line-height: 1.4;
    white-space: nowrap;
  }

  .standby-facility-name__subtitle {
    font-size: clamp(16px, 2vw, 26px);
    margin-top: 12px;
  }

  /* 操作エリアを左側40%に配置 */
  .standby-operation-area {
    width: 40%;
    max-width: none;
    padding: 100px 60px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    justify-content: center;
    gap: 60px;
  }

  /* ボタンを斜めに配置し、サイズを大幅に拡大 */
  .standby-buttons {
    width: 100%;
    height: 800px; /* 大きなディスプレイ用に高さを拡大（ボタンサイズ拡大に対応） */
  }

  .standby-button {
    width: 400px !important;
    height: 400px !important;
    min-width: 400px !important;
    min-height: 400px !important;
    font-size: 42px !important;
    padding: 42px !important;
    gap: 24px;
  }

  /* 55インチディスプレイでもワインボタンは左上 */
  .standby-button[data-type="wine"] {
    top: 0;
    left: 0;
  }

  /* 55インチディスプレイでもビールボタンは右下 */
  .standby-button[data-type="beer"] {
    bottom: 0;
    right: 0;
  }

  .standby-button svg {
    width: 80px;
    height: 80px;
  }

  /* 2重線の内側の円も55インチ用に調整 */
  .standby-button::after {
    top: 14px !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 14px !important;
    border-width: 3px !important;
  }

  /* タッチ誘導ボタンのサイズ調整（55インチ用） */
  .signage-container .standby-touch-button {
    width: 400px !important;
    height: 400px !important;
    padding: 42px !important;
  }

  /* 55インチ用：内側の円のサイズ調整 */
  .signage-container .standby-touch-button::after {
    top: 14px !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 14px !important;
    border-width: 3px !important;
  }

  .signage-container .standby-touch-button__label {
    font-size: 42px !important;
  }

  /* 55インチ用：しずくのサイズも小さく調整 */
  .standby-droplet {
    width: 24px;
    height: 24px;
  }
}
