/* ════════════════════════════════════════════════════════
   おしらせ機能のスタイル（Issue #1350）
   ・#announcement-modal … 一覧 / 詳細を切り替える単一モーダル
   ・.title-announcement-button … タイトル画面常設「おしらせ」ボタン
   ・.announcement-btn-badge … 未読がある場合の黄色ドット
   trophy.css（#trophy-modal）と同じ情報設計・操作感を踏襲する。
   ════════════════════════════════════════════════════════ */

#announcement-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.62); z-index: 900;
  align-items: center; justify-content: center; padding: 16px;
}
#announcement-modal.open { display: flex; }

#announcement-box {
  background: #fff; border-radius: 24px;
  padding: 22px 18px 18px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: popIn .35s cubic-bezier(.34,1.56,.64,1);
}

#announcement-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 14px;
}
#announcement-header h2 { font-size: 1.2rem; color: #e07b39; margin: 0; }

#announcement-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.announcement-empty { padding: 30px 10px; text-align: center; color: #aaa; font-size: .88rem; }

.announcement-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  background: #f7f7f7; border: 2px solid transparent; border-radius: 16px;
  padding: 10px 12px; cursor: pointer; transition: transform .12s;
  text-align: left; width: 100%; font-family: inherit;
}
.announcement-item:active { transform: scale(.97); }

.announcement-item-icon {
  flex: 0 0 46px; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: #fff; border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.05);
  overflow: hidden;
}
.announcement-item-icon-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.announcement-item-body { flex: 1 1 auto; min-width: 0; }
.announcement-item-title { font-size: .95rem; font-weight: bold; color: #555; }
.announcement-item-desc {
  font-size: .78rem; color: #999; margin-top: 2px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.announcement-item-version { font-size: .68rem; color: #b98c5a; margin-top: 3px; font-weight: bold; }

.announcement-new-badge {
  position: absolute; top: -7px; right: -5px;
  background: #ffd54d; color: #7a4a00;
  font-size: .62rem; font-weight: bold; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
}

#announcement-detail-panel { text-align: center; padding: 4px 4px 8px; }
#announcement-detail-image {
  width: min(64vw, 220px); height: min(64vw, 220px);
  max-width: 220px; max-height: 220px;
  margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  font-size: clamp(48px, 16vw, 84px);
  background: #fff7df; border: 3px solid #ffd88f; border-radius: 22px;
  overflow: hidden;
}
.announcement-item-icon-image,
#announcement-detail-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
#announcement-detail-title {
  font-size: clamp(1.2rem, 5vw, 1.5rem); font-weight: bold; color: #e07b39; margin-bottom: 10px;
}
#announcement-detail-body {
  font-size: clamp(.95rem, 3.6vw, 1.1rem); color: #526b77; line-height: 1.7; margin-bottom: 10px;
}
.announcement-detail-variations { list-style: none; margin: 8px 0 0; padding: 0; font-weight: bold; }
#announcement-detail-version { font-size: .78rem; color: #b98c5a; font-weight: bold; margin-bottom: 16px; }

.announcement-detail-primary {
  display: block; margin: 0 auto; padding: 12px 32px; min-height: 48px;
  border: none; border-radius: 20px; background: var(--orange, #e07b39);
  color: #fff; font-family: inherit; font-size: 1rem; font-weight: bold; cursor: pointer;
}
.announcement-detail-primary:active { transform: scale(.96); }

#announcement-close {
  display: block; margin: 12px auto 0; padding: 10px 34px; min-height: 44px;
  border: none; border-radius: 20px; background: #fff; color: #a17a49;
  border: 2px solid #e6d3b3;
  font-family: inherit; font-size: .92rem; font-weight: bold; cursor: pointer;
}
#announcement-close:active { transform: scale(.95); }

/* .title-sound-notice（既存のタイトル常設ボタン）と同じ静的flow・見た目の型を踏襲し、
   タイトルカードのレイアウト（Smartphone/Tablet/Desktop対応済みの既存centered card）に
   独自のposition:absolute/fixedを持ち込まない。 */
.title-announcement-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: #73583d;
  background: rgba(255,255,255,.62);
  font: 800 clamp(.78rem, 1.8vw, .92rem)/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.title-announcement-button:active { transform: scale(.96); }
.title-announcement-button:focus-visible { outline: 5px solid #2368c4; outline-offset: 5px; }

.announcement-btn-badge {
  position: absolute; top: 2px; right: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #ffd233; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.25);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .announcement-item,
  .announcement-detail-primary,
  #announcement-close,
  .title-announcement-button { transition: none !important; }
}
