/**
 * Device Fortress エラーページ共通スタイル
 * 
 * レスポンシブデザイン対応：
 * - デスクトップ
 * - タブレット
 * - スマートフォン
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol";
  background: linear-gradient(135deg, #42b883 0%, #1a7f64 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* タッチデバイス向けのスムーズスクロール */
  -webkit-overflow-scrolling: touch;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 48px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1 {
  color: #2d3748;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

p {
  color: #718096;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.error-code {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  color: #cbd5e0;
  font-size: 12px;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.5px;
}

button {
  background: #42b883;
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 8px;
  box-shadow: 0 2px 8px rgba(66, 184, 131, 0.08);
}

button:hover {
  background: #1a7f64;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(66, 184, 131, 0.18);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  color: #a0aec0;
}

#result {
  margin-top: 24px;
  padding: 16px;
  background: #f7fafc;
  border-radius: 8px;
  text-align: left;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #2d3748;
  white-space: pre-wrap;
  word-wrap: break-word;
  display: none;
}

#result.show {
  display: block;
}

#result.error {
  background: #fff5f5;
  color: #c53030;
}

#result.success {
  background: #f0fff4;
  color: #22543d;
}

.status {
  display: inline-block;
  padding: 8px 16px;
  background: #48bb78;
  color: white;
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 32px;
}

/* スマートフォン横向き対応（画面内に収める） */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .container {
    padding: 20px 32px;
    max-width: 90%;
    margin: auto;
  }

  .icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }

  h1 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  p {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 16px;
  }

  .error-code {
    font-size: 10px;
    margin-top: 12px;
    padding-top: 12px;
  }
}

/* タブレット（横向き）対応 */
@media (min-height: 501px) and (max-width: 768px) and (orientation: landscape) {
  body {
    padding: 16px;
  }

  .container {
    padding: 32px 40px;
    max-width: 600px;
  }

  .icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 12px;
  }

  p {
    font-size: 15px;
    margin-bottom: 24px;
  }
}

/* タブレット（縦向き）対応 */
@media (max-width: 768px) {
  .container {
    padding: 40px 32px;
  }

  h1 {
    font-size: 26px;
  }
}

/* スマートフォン対応（縦向き） */
@media (max-width: 480px) and (orientation: portrait) {
  body {
    padding: 16px;
  }

  .container {
    padding: 32px 24px;
    border-radius: 12px;
  }

  .icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  p {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
  }

  .error-code {
    font-size: 11px;
    margin-top: 20px;
    padding-top: 20px;
  }
}

/* 小型スマートフォン対応 */
@media (max-width: 360px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 24px 20px;
  }

  .icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
  }

  h1 {
    font-size: 20px;
  }

  p {
    font-size: 14px;
  }
}

/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .icon img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
  /* 必要に応じてダークモードスタイルを追加 */
}
