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

/* ===== 研究所に戻るボタン ===== */
.logo-wrap {
  position: relative;
  display: inline-block;
}

.back-to-lab {
  position: absolute;
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.15) 60%);
  border: 1.5px solid rgba(255,255,255,0.7);
  box-shadow: 0 4px 16px rgba(180,200,255,0.3), inset 0 1px 3px rgba(255,255,255,0.8), inset 0 -2px 6px rgba(150,180,255,0.2);
  backdrop-filter: blur(6px);
  text-decoration: none;
  font-size: 11px;
  font-weight: bold;
  color: #555;
  text-align: center;
  line-height: 1.4;
  transition: all 0.25s;
  animation: float-bubble 3s ease-in-out infinite;
}

@media (max-width: 768px) {
  .back-to-lab {
    width: 58px;
    height: 58px;
    font-size: 11px;
    left: -66px;
  }
}

.back-to-lab:hover {
  transform: translateY(calc(-50% - 3px));
  box-shadow: 0 8px 24px rgba(180,200,255,0.45), inset 0 1px 3px rgba(255,255,255,0.9);
}

@keyframes float-bubble {
  0%, 100% { transform: translateY(-50%); }
  50%       { transform: translateY(calc(-50% - 6px)); }
}

.back-arrow {
  font-size: 18px;
  line-height: 1;
}

/* ===== 左右スタンプカラム ===== */
.side-column {
  position: fixed;
  top: 0;
  width: 140px;
  height: 100vh;
  overflow: hidden;
  pointer-events: auto;
  z-index: 0;
}

.side-left  { left: 0; }
.side-right { right: 0; }

/* ===== スマホ用：下に流れるスタンプ帯 ===== */
.bottom-strip {
  display: none;
  width: 100%;
  overflow: hidden;
  padding: 8px 0;
}

.bottom-track {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: max-content;
  animation-duration: 30s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-delay: 0.5s;
}

.track-ltr { animation-name: scroll-right; }
.track-rtl { animation-name: scroll-left; }

@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes scroll-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.bottom-stamp-img {
  width: 90px;
  height: 90px;
  min-width: 90px;
  object-fit: contain;
  border-radius: 10px;
  opacity: 0.75;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .side-column { display: none; }
  .bottom-strip { display: block; }
  .screen { flex-direction: column; justify-content: flex-start; }
  .container { padding-top: 4px; padding-bottom: 4px; }
  .logo-img { width: 38px; height: 38px; }
  .logo { margin-bottom: 2px; }
  h1 { font-size: 18px; margin-bottom: 0; }
  .subtitle { font-size: 10px; margin-bottom: 2px; }
  .question-box { padding: 10px; margin-top: 2px; margin-bottom: 8px; }
  .question-label { font-size: 13px; margin-bottom: 6px; }
  .choices { gap: 6px; }
  .choice-btn { padding: 7px 6px; font-size: 13px; }
  .btn-main { padding: 11px; font-size: 15px; margin-bottom: 4px; }
  .note { font-size: 9px; }
  .bottom-stamp-img { width: 70px; height: 70px; }
  .bottom-strip { padding: 4px 0; }
}

.side-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.side-left  .side-track { animation: scroll-down 50s linear infinite; }
.side-right .side-track { animation: scroll-up   50s linear infinite; }

@keyframes scroll-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

@keyframes scroll-down {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0); }
}

.side-stamp-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.side-stamp-img:hover {
  transform: scale(1.12);
  opacity: 1;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
  background: linear-gradient(135deg, #fff0f5 0%, #ffe8f0 50%, #fff5e0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 画面切り替え ===== */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.screen.active {
  display: flex;
}

.container {
  max-width: 420px;
  width: 90%;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

/* ===== トップ画面 ===== */
.logo {
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

h1 {
  font-size: 28px;
  font-weight: 900;
  color: #d4436a;
  line-height: 1.4;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 32px;
}

.question-box {
  background: white;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(212, 67, 106, 0.1);
}

.question-label {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  background: #fff0f5;
  border: 2px solid #ffd6e4;
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #555;
}

.choice-btn:hover {
  background: #ffe0eb;
  border-color: #d4436a;
}

.choice-btn.selected {
  background: #d4436a;
  border-color: #d4436a;
  color: white;
  font-weight: bold;
}

.btn-main {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #d4436a, #ff7096);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(212, 67, 106, 0.4);
  margin-bottom: 16px;
}

.btn-main:disabled {
  background: #ddd;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-main:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 67, 106, 0.5);
}

.note {
  font-size: 11px;
  color: #aaa;
}

/* ===== ローディング画面 ===== */
.loading-animation {
  font-size: 80px;
  animation: spin-bounce 1s ease-in-out infinite;
  margin-bottom: 24px;
}

@keyframes spin-bounce {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(10deg) scale(1.1); }
  50%  { transform: rotate(0deg) scale(1); }
  75%  { transform: rotate(-10deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1); }
}

.loading-text {
  font-size: 18px;
  color: #d4436a;
  font-weight: bold;
  line-height: 1.6;
}

/* ===== 結果画面 ===== */
.result-label {
  font-size: 15px;
  color: #d4436a;
  font-weight: bold;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.stamp-card {
  background: white;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(212, 67, 106, 0.15);
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#result-img {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.stamp-name {
  font-size: 14px;
  color: #666;
  font-weight: bold;
}

.btn-store {
  display: block;
  background: #06c755;
  color: white;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.btn-store:hover {
  background: #05b04a;
  transform: translateY(-1px);
}

.share-area {
  background: white;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.share-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-share {
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-img-share {
  background: linear-gradient(135deg, #d4436a, #ff7096);
  color: white;
  font-size: 15px;
}
.btn-img-share:hover { background: linear-gradient(135deg, #c03860, #e85f82); }
.btn-img-share:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-x {
  background: #000;
  color: white;
}
.btn-x:hover { background: #333; }

.btn-line {
  background: #06c755;
  color: white;
}
.btn-line:hover { background: #05b04a; }

.btn-copy {
  background: #f0f0f0;
  color: #333;
}
.btn-copy:hover { background: #e0e0e0; }
.btn-copy.copied {
  background: #d4436a;
  color: white;
}

.btn-nav {
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 12px;
  border: 2px dashed #ccc;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  color: #888;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-nav:hover {
  border-color: #d4436a;
  color: #d4436a;
  background: #fff0f5;
}

/* ===== シェア画像モーダル ===== */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.share-modal-box {
  background: white;
  border-radius: 20px;
  padding: 20px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.share-modal-hint {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}

.share-modal-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 14px;
}

.share-modal-close {
  background: #f0f0f0;
  border: none;
  border-radius: 10px;
  padding: 10px 28px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
}

.share-modal-close:hover { background: #e0e0e0; }

.btn-retry {
  background: none;
  border: 2px solid #d4436a;
  color: #d4436a;
  padding: 12px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-retry:hover {
  background: #d4436a;
  color: white;
}
