/* cat-widget-dot.css */

/* ========== 変数・カラー定義 ========== */
:root {
  --cat-widget-bg-morning: #f0fdf4; /* 薄い緑系 */
  --cat-widget-bg-daytime: #f8fafc; /* 薄い青系 */
  --cat-widget-bg-evening: #fff1f2; /* 薄い赤系 */
  --cat-widget-bg-night: #1e1b4b; /* 濃い紺色（ダーク） */

  --cat-widget-text-dark: #334155;
  --cat-widget-text-light: #e2e8f0;
}

/* ========== ウィジェットコンテナ（レトロなゲーム機風枠組み） ========== */
.cat-widget {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spacing-4);
  background-color: var(--cat-widget-bg-daytime);
  transition: background-color 1s ease;

  /* ダークテーマのカードと馴染ませるための微調整 */
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 時間帯ごとの背景 */
.cat-widget--morning {
  background-color: var(--cat-widget-bg-morning);
}
.cat-widget--daytime {
  background-color: var(--cat-widget-bg-daytime);
}
.cat-widget--evening {
  background-color: var(--cat-widget-bg-evening);
}
.cat-widget--night {
  background-color: var(--cat-widget-bg-night);
}

/* 時間帯オーバーレイ（夜間などは全体を暗くする） */
.cat-widget::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: background-color 1s ease;
}
.cat-widget--morning::after {
  background-color: rgba(253, 224, 71, 0.05);
}
.cat-widget--daytime::after {
  background-color: transparent;
}
.cat-widget--evening::after {
  background-color: rgba(249, 115, 22, 0.15);
}
.cat-widget--night::after {
  background-color: rgba(0, 0, 0, 0.3);
}

/* ========== シーン・アニメーター ========== */
.cat-widget__scene {
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.cat-widget__scene:hover {
  filter: brightness(1.1);
}

.cat-widget__canvas-wrapper {
  position: absolute;
  bottom: 0;
  width: 120px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* ドット絵のシャープな表示を維持（アンチエイリアス無効化） */
.cat-dot-canvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 0px rgba(0, 0, 0, 0.15));
}

/* ========== 吹き出し ========== */
.cat-widget__bubble {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: white;
  color: var(--cat-widget-text-dark);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 10;
  /* ドット絵風フォントがあれば最高だが、一旦丸ゴシックで */
  font-family: "Zen Maru Gothic", "Noto Sans JP", sans-serif;
  border: 2px solid #333; /* レトロゲーム感を出すための太枠 */
}

/* 吹き出しのしっぽ */
.cat-widget__bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.cat-widget__bubble::before {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: white transparent transparent transparent;
  z-index: 1;
}

.cat-widget__bubble--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== インジケーター・装飾 ========== */
.cat-widget__info {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
  font-family: monospace; /* レトロ風 */
}
.cat-widget--morning .cat-widget__info,
.cat-widget--daytime .cat-widget__info,
.cat-widget--evening .cat-widget__info {
  color: rgba(0, 0, 0, 0.4);
}

.cat-widget__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
  display: inline-block;
  box-shadow: 0 0 5px currentColor;
}

/* 紙吹雪用（流用） */
.cat-widget__confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.cat-widget__confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  background: red;
  opacity: 0;
}

/* ========== レスポンシブ ========== */
@media (max-width: 768px) {
  .cat-widget {
    height: 120px;
  }
  .cat-widget__scene {
    width: 240px;
    height: 80px;
  }
  .cat-widget__canvas-wrapper {
    width: 100px;
    height: 80px;
  }
}
