import { css } from '@emotion/react';

interface TutorialWelcomeCardProps {
  onStart: () => void;
}

const overlayStyle = css`
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
`;

const cardStyle = css`
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 28px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
`;

const iconStyle = css`
  font-size: 56px;
  line-height: 1;
`;

const titleStyle = css`
  font-size: 22px;
  font-weight: 700;
  color: #191919;
  text-align: center;
`;

const rulesContainerStyle = css`
  background: #f7f8fa;
  border-radius: 14px;
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
`;

const copyStyle = css`
  font-size: 15px;
  color: #555;
  text-align: center;
  line-height: 1.5;
`;

const ruleItemStyle = css`
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #333;
  line-height: 1.4;
`;

const ruleIconStyle = css`
  font-size: 20px;
  flex-shrink: 0;
`;

const startButtonStyle = css`
  background: #3182f6;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 16px 0;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  letter-spacing: -0.3px;
`;

export function TutorialWelcomeCard({ onStart }: TutorialWelcomeCardProps) {
  return (
    <div css={overlayStyle}>
      <div css={cardStyle}>
        <div css={iconStyle}>✨</div>
        <h2 css={titleStyle}>Archetype: FirstSpark</h2>
        <p css={copyStyle}>원소를 합성해서 새로운 세계를 만들어보세요</p>
        <div css={rulesContainerStyle}>
          <div css={ruleItemStyle}>
            <span css={ruleIconStyle}>⚗️</span>
            <span>원소는 시간이 지나면 <strong>자동으로 수집</strong>돼요</span>
          </div>
          <div css={ruleItemStyle}>
            <span css={ruleIconStyle}>🔗</span>
            <span>두 원소를 <strong>합성</strong>해 새로운 원소를 발견하세요</span>
          </div>
          <div css={ruleItemStyle}>
            <span css={ruleIconStyle}>⬆️</span>
            <span><strong>강화</strong>하면 수집 속도가 빨라져요</span>
          </div>
        </div>
        <button css={startButtonStyle} onClick={onStart}>시작하기</button>
      </div>
    </div>
  );
}
