@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --olive: #6b7c3a;
  --dark-olive: #4a5628;
  --light-olive: #a8b86b;
  --cream: #f5f0dc;
  --warm-brown: #8b5e3c;
  --dark-brown: #4a2c1a;
  --yellow: #f5c800;
  --yellow-dark: #c9a200;
  --yellow-light: #ffe566;
  --pink: #e8a0a0;
  --bg: #0a0a0a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
}

body {
  background-color: var(--bg);
  font-family: 'Press Start 2P', monospace;
  color: var(--cream);
  overflow-x: hidden;
}

/* ドット絵スターフィールド背景 */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--cream);
  animation: twinkle 2s infinite step-end;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* メインコンテナ */
.container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* ヘッダー */
.header {
  text-align: center;
  padding: 40px 20px 20px;
}

.pixel-border {
  display: inline-block;
  border: 4px solid var(--yellow);
  box-shadow:
    -4px 0 0 var(--yellow-dark),
    4px 0 0 var(--yellow-dark),
    0 -4px 0 var(--yellow-dark),
    0 4px 0 var(--yellow-dark),
    -8px 0 0 #000,
    8px 0 0 #000,
    0 -8px 0 #000,
    0 8px 0 #000;
  padding: 36px 48px;
  background: #111;
  margin-bottom: 24px;
}

.title-small {
  font-size: 10px;
  color: var(--yellow);
  margin-bottom: 12px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--yellow-dark);
}

.title-main {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: clamp(24px, 6vw, 56px);
  font-weight: bold;
  white-space: nowrap;
  color: var(--yellow-light);
  text-shadow:
    3px 3px 0 var(--yellow-dark),
    6px 6px 0 #000;
  line-height: 1.4;
  animation: pulse-glow 1.5s infinite step-end;
}

@keyframes pulse-glow {
  0%, 100% { color: var(--yellow-light); }
  50% { color: #fff; }
}

.title-sub {
  font-size: 11px;
  color: var(--yellow);
  margin-top: 8px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--yellow-dark);
}

.header-date {
  font-size: 8px;
  color: var(--yellow);
  margin-top: 8px;
  animation: blink-cursor 1s infinite step-end;
}

/* キャラクター画像 */
.camera-section {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: 20px 0;
}

.mahiru-img {
  width: 280px;
  height: auto;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.chihiro-img {
  width: 280px;
  height: auto;
  flex-shrink: 0;
  image-rendering: pixelated;
}

@media (max-width: 600px) {
  .mahiru-img {
    width: 46vw;
  }
  .chihiro-img {
    width: 46vw;
  }
}

.shutter-flash {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

/* メッセージボックス */
.message-box {
  background: #111;
  border: 4px solid var(--yellow);
  box-shadow:
    inset 0 0 0 2px var(--yellow-dark),
    4px 4px 0 #000;
  padding: 20px;
  margin: 20px 0;
  position: relative;
}

.message-box::before {
  content: '▶';
  position: absolute;
  bottom: -20px;
  right: 20px;
  color: var(--yellow);
  font-size: 12px;
  animation: blink-cursor 1s infinite step-end;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.message-text {
  font-size: 14px;
  line-height: 2.2;
  color: var(--cream);
}

.message-text .name {
  color: var(--yellow);
}

.message-text .aside {
  color: var(--light-olive);
}

/* ステータスパネル */
.status-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 30px 0;
}

.status-card {
  background: var(--dark-brown);
  border: 4px solid var(--dark-olive);
  padding: 16px;
  box-shadow: 4px 4px 0 #000;
}

.status-card--full {
  grid-column: 1 / -1;
}

.status-label {
  font-size: 7px;
  color: var(--light-olive);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.status-value {
  font-size: 9px;
  color: var(--cream);
  line-height: 1.8;
}

.hp-bar {
  margin-top: 8px;
}

.hp-bar-bg {
  height: 12px;
  background: var(--dark-olive);
  border: 2px solid var(--olive);
  position: relative;
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  background: var(--light-olive);
  animation: hp-pulse 2s infinite step-end;
}

@keyframes hp-pulse {
  0%, 100% { background: var(--light-olive); }
  50% { background: var(--yellow); }
}

.hp-bar-value {
  font-size: 7px;
  color: var(--light-olive);
  margin-top: 6px;
  text-align: right;
}

/* 写真フレーム */
.photo-section {
  margin: 30px 0;
}

.photo-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.photo-frame {
  width: 120px;
  height: 100px;
  border: 4px solid var(--cream);
  box-shadow:
    4px 4px 0 var(--warm-brown),
    8px 8px 0 var(--dark-brown);
  background: var(--dark-brown);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s step-end;
}

.photo-frame:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    6px 6px 0 var(--warm-brown),
    10px 10px 0 var(--dark-brown);
}

.photo-frame .photo-label {
  position: absolute;
  bottom: 4px;
  font-size: 6px;
  color: var(--light-olive);
  text-align: center;
  width: 100%;
}

.photo-hint {
  text-align: center;
  font-size: 7px;
  color: var(--olive);
  margin-top: 12px;
}

/* ドット絵区切り線 */
.pixel-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}

.pixel-divider::before,
.pixel-divider::after {
  content: '';
  flex: 1;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--yellow) 0px,
    var(--yellow) 8px,
    transparent 8px,
    transparent 16px
  );
}

.pixel-divider span {
  font-size: 8px;
  color: var(--yellow);
  white-space: nowrap;
}

/* セクションタイトル */
.section-title {
  font-size: 10px;
  color: var(--light-olive);
  text-align: center;
  margin-bottom: 16px;
  text-shadow: 2px 2px 0 var(--dark-olive);
}

/* フッター */
.footer {
  text-align: center;
  padding: 40px 20px;
}

.birthday-counter {
  background: #111;
  border: 4px solid var(--yellow);
  box-shadow:
    -4px 0 0 var(--yellow-dark),
    4px 0 0 var(--yellow-dark),
    0 -4px 0 var(--yellow-dark),
    0 4px 0 var(--yellow-dark),
    8px 8px 0 #000;
  padding: 20px;
  display: inline-block;
  margin: 20px 0;
}

.counter-label {
  font-size: 8px;
  color: var(--yellow);
  margin-bottom: 12px;
}

.counter-date {
  font-size: clamp(12px, 2.5vw, 18px);
  color: var(--yellow-light);
  text-shadow: 3px 3px 0 var(--yellow-dark);
}

.footer-credits {
  font-size: 7px;
  color: var(--light-olive);
  line-height: 2.5;
  margin-top: 16px;
}

.footer-credits .quote {
  color: var(--olive);
}

.footer-copyright {
  font-size: 6px;
  color: var(--dark-olive);
  margin-top: 24px;
}

/* 花火アニメーション（ドット風） */
.fireworks {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 12px;
  image-rendering: pixelated;
  animation: confetti-fly 1.4s steps(14) forwards;
}

@keyframes confetti-fly {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 0; }
}

/* スクロールバー */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--yellow); }

/* CRT エフェクト */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.05) 2px,
    rgba(0,0,0,0.05) 4px
  );
  pointer-events: none;
  z-index: 200;
}
