* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ローディング画面 */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: #fff;
}

.loading-title {
  font-family: 'Shadows Into Light', cursive;
  font-size: 4rem;
  margin-bottom: 30px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.loading-bar {
  width: 300px;
  height: 4px;
  background: #333;
  margin: 0 auto;
  border: 2px solid #fff;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: #fff;
  width: 0%;
  animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

/* スタート画面 */
.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.start-screen.fade-in {
  opacity: 1;
}

.start-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.start-content {
  text-align: center;
  color: #fff;
}

.start-title {
  font-family: 'Shadows Into Light', cursive;
  font-size: 5rem;
  margin-bottom: 30px;
}

.start-description {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  margin-bottom: 50px;
  opacity: 0.8;
}

.start-button {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: #fff;
  color: #000;
  border: 4px solid #fff;
  padding: 25px 60px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.start-button:hover {
  background: #000;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.8);
}

.start-button:active {
  transform: scale(0.95);
}

body {
  font-family: 'Courier New', Courier, monospace;
  background: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  position: relative;
}

/* 広告を下部に配置 */
body > div[style*="adsbygoogle"],
body > div:has(.adsbygoogle) {
  order: 10;
  width: 100%;
  max-width: 700px;
  margin-top: 20px;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,.03) 2px, rgba(255,255,255,.03) 4px);
  pointer-events: none;
  animation: scanline 8s linear infinite;
  z-index: 0;
}

@keyframes scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

.container {
  max-width: 700px;
  width: 100%;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.8);
  overflow: hidden;
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* ヘッダー */
header {
  background: #000;
  color: #fff;
  padding: 40px 30px;
  text-align: center;
  border-bottom: 3px solid #fff;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 900;
}

header h1.cursive-title {
  font-family: 'Shadows Into Light', cursive;
  font-size: 4rem;
  letter-spacing: 0.05em;
  text-transform: none;
  font-weight: 400;
  margin: 0;
}

header h1 i {
  margin-right: 15px;
}

.subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* メインコンテンツ */
main {
  padding: 60px 40px;
  background: #fff;
}

/* ドアコンテナ */
.door-container {
  text-align: center;
  margin-bottom: 50px;
}

/* ドア */
.door {
  width: 350px;
  height: 500px;
  margin: 0 auto 30px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.door:hover {
  opacity: 0.9;
}

.door.flash {
  animation: flashEffect 0.3s ease;
}

@keyframes flashEffect {
  0%, 100% { filter: invert(0); }
  50% { filter: invert(1); }
}

.door-frame {
  width: 100%;
  height: 100%;
}

.door-panel {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('../door.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ドアノブ（door.pngに含まれているため非表示） */
.door-handle {
  display: none;
}

/* ノッキングアニメーション */
.door.knocking {
  animation: knockDoor 0.4s ease;
}

@keyframes knockDoor {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

/* ステータス表示 */
.status {
  margin-top: 25px;
  padding: 15px 20px;
  font-weight: 700;
  display: none;
  border: 3px solid #000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.status.success {
  background: #000;
  color: #fff;
}

.status.warning {
  background: #fff;
  color: #000;
  border-style: dashed;
}

.status.error {
  background: #000;
  color: #fff;
  animation: blink 0.5s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0.5; }
}

/* 統計情報 */
.stats {
  display: flex;
  gap: 0;
  justify-content: center;
  padding: 0;
  border: 3px solid #000;
  border-left: none;
  border-right: none;
  margin-top: 50px;
}

.stat-item {
  text-align: center;
  flex: 1;
  padding: 30px 20px;
  border-right: 3px solid #000;
  position: relative;
}

.stat-item:last-child {
  border-right: none;
}

.stat-label {
  font-size: 0.7rem;
  color: #000;
  margin-bottom: 15px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
}

.stat-value {
  font-size: 3rem;
  font-weight: 900;
  color: #000;
  margin-bottom: 10px;
  line-height: 1;
}

.stat-unit {
  font-size: 0.7rem;
  color: #000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

/* フッター */
footer {
  padding: 40px 30px;
  background: #000;
  text-align: center;
  border-top: 3px solid #000;
  user-select: text;
  -webkit-user-select: text;
}

.button-row {
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-button {
  display: inline-block;
  background: #fff;
  color: #000;
  border: 3px solid #fff;
  padding: 15px 40px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.share-button:hover {
  background: #000;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.5);
}

.share-button i {
  margin-right: 8px;
}

.credit {
  margin-top: 10px;
}

.credit p {
  font-size: 0.75rem;
  color: #fff;
  letter-spacing: 0.05em;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .container {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
  }

  .start-title {
    font-size: 3rem;
  }

  .start-description {
    font-size: 0.9rem;
    padding: 0 20px;
  }

  .start-button {
    font-size: 1.2rem;
    padding: 20px 40px;
  }

  .loading-title {
    font-size: 3rem;
  }

  header {
    padding: 30px 20px;
  }

  header h1 {
    font-size: 1.8rem;
    letter-spacing: 0.05em;
  }

  .subtitle {
    font-size: 0.65rem;
  }

  main {
    padding: 40px 20px;
  }

  .door {
    width: 260px;
    height: 380px;
  }

  .stats {
    flex-wrap: wrap;
  }

  .stat-item {
    flex-basis: 100%;
    border-right: none;
    border-bottom: 3px solid #000;
    padding: 25px 15px;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  .stat-value {
    font-size: 2.5rem;
  }

  footer {
    padding: 30px 20px;
  }

  .share-button {
    padding: 12px 30px;
    font-size: 0.85rem;
  }
}

/* 波紋エフェクト */
.ripple {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #000;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: rippleEffect 1s ease-out forwards;
  z-index: 9999;
}

/* ゴースト用の薄い波紋 */
.ripple-ghost {
  border: 2px solid rgba(0, 0, 0, 0.2);
}

@keyframes rippleEffect {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}
