*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: #222;
  background: radial-gradient(circle at top, #fff7e6 0, #ffe6f2 40%, #f5f7ff 100%);
}

.app {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-header {
  text-align: center;
}

.app-title {
  margin: 8px 0 8px;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ff8a5c, #ff5c9a);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-wrap {
  margin: 0 auto 4px;
  max-width: 640px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
}

.app-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 18px 18px 20px;
}

.card--main {
  position: relative;
  overflow: hidden;
}

.card--main::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 138, 92, 0.25),
    rgba(255, 92, 154, 0.35),
    rgba(245, 247, 255, 0.1),
    rgba(255, 138, 92, 0.25)
  );
  animation: spin-orbit 12s linear infinite;
  opacity: 0.8;
}

.card-body {
  position: relative;
  z-index: 1;
}

.card-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ff8a5c;
  margin: 0 0 6px;
}

.card-text {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #ff8a5c, #ff5c9a);
  box-shadow: 0 6px 12px rgba(255, 122, 122, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(255, 122, 122, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(255, 122, 122, 0.35);
}

.btn-secondary {
  color: #ff5c9a;
  background: #fff;
  border: 1px solid rgba(255, 92, 154, 0.15);
}

.btn-secondary:hover {
  background: #fff3f8;
}

.result {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 18px 18px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.result-appear {
  animation: result-pop 380ms ease-out;
}

.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 4px;
}

.loading-text {
  margin: 0;
  font-size: 0.9rem;
  color: #777;
}

.result-content {
  animation: fade-in 260ms ease-out;
}

.result-rank-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #777;
}

.result-rank {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff5c9a;
}

.result-message {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.result-hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: #777;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.result-note {
  margin: 0;
  font-size: 0.8rem;
  color: #777;
}

.app-footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.75rem;
  color: #999;
}

.app-footer-text {
  margin: 0;
  line-height: 1.6;
}

.hidden {
  display: none;
}

.sp-only {
  display: inline;
}

@media (min-width: 600px) {
  .app {
    padding: 32px 16px 40px;
  }

  .sp-only {
    display: none;
  }
}

/* ==== アニメーション・装飾 =================================== */

.orbital {
  position: relative;
  width: 80px;
  height: 80px;
}

.orbital-core {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff8a5c, #ff5c9a);
  box-shadow: 0 0 18px rgba(255, 92, 154, 0.7);
  animation: pulse 1.4s ease-in-out infinite;
}

.orbital-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 92, 154, 0.65);
  animation: spin 3s linear infinite;
}

@keyframes spin-orbit {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-pop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
