@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

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

body {
  font-family: 'Noto Sans JP', monospace;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 20px;
  flex-direction: column-reverse;
}

.receipt-container {
  perspective: 1000px;
  animation: fadeIn 0.8s ease-out;
}

.receipt {
  background: white;
  width: 380px;
  padding: 30px 20px;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  position: relative;
  animation: receiptDrop 1s ease-out;
  transform-origin: top center;
}

.receipt::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8), white);
}

.receipt::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 3px,
    #f0f0f0 3px,
    #f0f0f0 6px
  );
}

.receipt-header {
  text-align: center;
  margin-bottom: 20px;
}

.store-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.store-info {
  font-size: 10px;
  color: #333;
  line-height: 1.6;
}

.divider {
  font-size: 10px;
  color: #999;
  margin: 10px 0;
  letter-spacing: -1px;
  overflow: hidden;
  text-align: center;
}

.date {
  font-size: 11px;
  text-align: center;
  margin: 10px 0;
  color: #333;
}

.story-content {
  margin: 20px 0;
  min-height: 300px;
}

.story-line {
  font-size: 13px;
  line-height: 1.8;
  color: #222;
  margin: 2px 0;
  text-align: center;
  animation: typeLine 0.5s ease-out backwards;
}

.story-line:nth-child(1) { animation-delay: 0.2s; }
.story-line:nth-child(2) { animation-delay: 0.4s; }
.story-line:nth-child(3) { animation-delay: 0.6s; }
.story-line:nth-child(4) { animation-delay: 0.8s; }
.story-line:nth-child(5) { animation-delay: 1.0s; }
.story-line:nth-child(6) { animation-delay: 1.2s; }
.story-line:nth-child(7) { animation-delay: 1.4s; }
.story-line:nth-child(8) { animation-delay: 1.6s; }
.story-line:nth-child(9) { animation-delay: 1.8s; }
.story-line:nth-child(10) { animation-delay: 2.0s; }
.story-line:nth-child(11) { animation-delay: 2.2s; }
.story-line:nth-child(12) { animation-delay: 2.4s; }
.story-line:nth-child(13) { animation-delay: 2.6s; }
.story-line:nth-child(14) { animation-delay: 2.8s; }
.story-line:nth-child(15) { animation-delay: 3.0s; }
.story-line:nth-child(16) { animation-delay: 3.2s; }
.story-line:nth-child(17) { animation-delay: 3.4s; }
.story-line:nth-child(18) { animation-delay: 3.6s; }
.story-line:nth-child(19) { animation-delay: 3.8s; }
.story-line:nth-child(20) { animation-delay: 4.0s; }
.story-line:nth-child(21) { animation-delay: 4.2s; }
.story-line:nth-child(22) { animation-delay: 4.4s; }

.receipt-footer {
  margin-top: 20px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin: 8px 0;
  color: #333;
}

.thank-you {
  text-align: center;
  font-size: 11px;
  margin: 15px 0;
  color: #333;
}

.barcode {
  text-align: center;
  font-size: 20px;
  letter-spacing: 1px;
  margin: 10px 0;
  color: #000;
}

.receipt-number {
  text-align: center;
  font-size: 9px;
  color: #666;
  margin-top: 5px;
}

.random-button {
  background: white;
  border: none;
  padding: 12px 24px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #667eea;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.random-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.random-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes receiptDrop {
  0% {
    transform: translateY(-100px) rotateX(-15deg);
    opacity: 0;
  }
  60% {
    transform: translateY(5px) rotateX(2deg);
  }
  100% {
    transform: translateY(0) rotateX(0);
    opacity: 1;
  }
}

@keyframes typeLine {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .receipt {
    width: 100%;
    max-width: 380px;
  }
}

