/* ============================
   create.css — 作る画面固有スタイル
   ============================ */

/* --- Page background --- */

body {
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 227, 196, 0.7), transparent 55%),
    radial-gradient(circle at 88% 16%, rgba(198, 231, 225, 0.65), transparent 55%),
    linear-gradient(120deg, #f5efe6 0%, #eef2f0 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(32deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.2) 6px, transparent 6px, transparent 18px);
  opacity: 0.3;
  pointer-events: none;
}

/* --- Layout --- */

.layout {
  margin-top: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* --- Card dashed border --- */

.card::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(224, 123, 67, 0.2);
  opacity: 0.6;
  pointer-events: none;
}

/* --- Toy Head --- */

.toy-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toy-head-row .btn {
  white-space: nowrap;
}

/* --- Shuffle Button Press Feedback --- */

#spinBtn {
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 6px 0 rgba(165, 95, 55, 0.35), 0 12px 18px rgba(42, 33, 25, 0.2);
}

#spinBtn:hover {
  filter: brightness(1.03);
}

#spinBtn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 2px 0 rgba(165, 95, 55, 0.35), 0 6px 12px rgba(42, 33, 25, 0.2);
}

#spinBtn:focus-visible {
  outline: 2px solid rgba(224, 123, 67, 0.55);
  outline-offset: 2px;
}

.toy-head h1 {
  margin: 0 0 6px 0;
  font-family: var(--font-display);
  font-size: 24px;
}

.toy-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* --- Slot Stage --- */

.slot-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

/* --- Slot Machine --- */

.slot-machine {
  border-radius: 18px;
  border: 2px solid #e7d4c2;
  background: linear-gradient(180deg, #fffaf2 0%, #f6e7d8 100%);
  padding: 16px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 6px 12px rgba(255, 255, 255, 0.7),
    inset 0 -10px 16px rgba(175, 130, 90, 0.12),
    0 14px 24px rgba(42, 33, 25, 0.12);
  transition: transform 0.3s ease;
}

.slot-machine.is-shuffling,
.person-select.is-shuffling {
  animation: shuffle-shake 0.35s ease-in-out;
}

@keyframes shuffle-shake {
  0%   { transform: translate(0, 0) rotate(0deg); }
  12%  { transform: translate(-5px, 3px) rotate(-0.8deg); }
  25%  { transform: translate(4px, -4px) rotate(1deg); }
  37%  { transform: translate(-6px, -2px) rotate(-0.6deg); }
  50%  { transform: translate(3px, 5px) rotate(0.7deg); }
  62%  { transform: translate(-4px, -3px) rotate(-0.9deg); }
  75%  { transform: translate(5px, 2px) rotate(0.5deg); }
  87%  { transform: translate(-2px, 2px) rotate(-0.3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* --- Slot Row --- */

.slot-column {
  display: grid;
  grid-template-rows: auto 40px minmax(160px, 1fr) 40px;
  gap: 8px;
  align-items: center;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(224, 123, 67, 0.15);
  border-radius: 14px;
  min-height: 260px;
}

.slot-label {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  justify-items: center;
  text-align: center;
}

.slot-label small {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(44, 111, 111, 0.75);
}

/* --- Slot Arrow --- */

.slot-arrow {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  color: var(--secondary);
  font-size: 18px;
  cursor: pointer;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    0 3px 6px rgba(0, 0, 0, 0.08);
  justify-self: center;
}

.slot-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Slot Window --- */

.slot-window {
  position: relative;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(44, 111, 111, 0.18);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    inset 0 -6px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.slot-window::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 33.33%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(44, 111, 111, 0.28) 0 4px, transparent 4px 8px);
  pointer-events: none;
}

.slot-window::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 66.66%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(44, 111, 111, 0.28) 0 4px, transparent 4px 8px);
  pointer-events: none;
}

/* --- Slot Item --- */

.slot-item {
  position: relative;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  text-align: center;
  font-size: 12px;
  padding: 10px 6px;
  z-index: 1;
  color: #7a685a;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-item.active {
  border-color: rgba(224, 123, 67, 0.6);
  background: rgba(224, 123, 67, 0.16);
  font-weight: 700;
  color: #3b2a1e;
  box-shadow: 0 4px 10px rgba(224, 123, 67, 0.18);
}

/* --- Toy Buttons / Footer --- */

.toy-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toy-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* --- Cache Info --- */

.cache-info {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(44, 111, 111, 0.12);
  border: 1px solid rgba(44, 111, 111, 0.25);
  font-size: 12px;
  display: grid;
  gap: 6px;
  min-width: 260px;
}

.cache-info strong {
  color: var(--secondary);
}

.cache-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(224, 123, 67, 0.2);
  border: 1px solid rgba(224, 123, 67, 0.35);
  font-size: 11px;
  font-weight: 700;
}

/* --- CTA Button --- */

.cta {
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(224, 123, 67, 0.28);
  animation: softPulse 2.6s ease-in-out infinite;
}

/* --- Person Select --- */

.person-select {
  border-radius: 18px;
  border: 2px solid #c2d8e7;
  background: linear-gradient(180deg, #f4f9ff 0%, #e3eef6 100%);
  padding: 18px 14px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 6px 12px rgba(255, 255, 255, 0.7),
    inset 0 -10px 16px rgba(90, 130, 175, 0.08),
    0 14px 24px rgba(25, 33, 42, 0.10);
}

.person-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.person-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.person-badge {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

.person-badge.is-a {
  background: rgba(224, 123, 67, 0.18);
  border-color: rgba(224, 123, 67, 0.5);
  color: var(--primary);
}

.person-badge.is-b {
  background: rgba(44, 111, 111, 0.16);
  border-color: rgba(44, 111, 111, 0.4);
  color: var(--secondary);
}

.person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-chip {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(44, 111, 111, 0.18);
  background: #fff;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.06);
}

.person-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.person-chip.is-a {
  border-color: rgba(224, 123, 67, 0.6);
  background: rgba(224, 123, 67, 0.18);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(224, 123, 67, 0.15);
}

.person-chip.is-b {
  border-color: rgba(44, 111, 111, 0.45);
  background: rgba(44, 111, 111, 0.16);
  color: var(--secondary);
  box-shadow: 0 4px 10px rgba(44, 111, 111, 0.12);
}

/* --- Hint / Note --- */

.hint {
  font-size: 12px;
  color: var(--muted);
}

.note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* --- Section Title (create) --- */

.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

/* --- Keyframes --- */

@keyframes softPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* --- Responsive --- */

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .slot-stage { grid-template-columns: 1fr; }
}
