@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard-dynamic-subset.css');

  html, body {
    margin: 0; padding: 0; height: 100%;
    background: #000; color: #fff;
    font-family: 'Pretendard', -apple-system, "Apple SD Gothic Neo", sans-serif;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    overflow: hidden;
  }
  #startBtn {
    padding: 16px 24px; font-size: 16px; border: none; border-radius: 10px;
    background: #4a7dff; color: white; cursor: pointer;
  }
  #status { margin-top: 24px; font-size: 15px; color: #999; text-align: center; }
  .typing-container {
    box-sizing: border-box;
    font-size: clamp(15px, 5.5vw, 35px);
    font-weight: 700;
    font-family: 'Pretendard';
    margin: 24px 0;
    width: min(500px, calc(100vw - 32px));
    min-height: 90px;
    max-height: 78vh;
    max-height: 78dvh;
    overflow: hidden;
    word-break: keep-all;
    overflow-wrap: anywhere;
    white-space: pre-line;
    text-align: center;
    color: #fff;
    line-height: 1.35;
  }

  @media (max-width: 480px) {
    .typing-container { margin: 14px 0; width: min(500px, calc(100vw - 24px)); line-height: 1.3; }
    #startBtn { padding: 12px 18px; font-size: 14px; }
    #status { margin-top: 16px; font-size: 13px; }
  }

  @media (max-width: 360px) {
    .typing-container { font-size: clamp(13px, 5vw, 35px); max-height: 82vh; max-height: 82dvh; }
  }
  #debugScore { position: fixed; bottom: 10px; right: 14px; color: #333; font-size: 12px; }
  .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .char.visible {
    opacity: 1;
    transform: translateY(0);
  }

  #colorFlash {
    position: fixed; inset: 0; pointer-events: none; z-index: 998;
    opacity: 0; transition: opacity 0.4s ease;
  }
  #colorFlash.show { opacity: 0.35; }

  #diceEmoji {
    position: fixed; top: 50%; left: 50%; z-index: 998;
    font-size: 80px; pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
  }
  #diceEmoji.rolling { transform: translate(-50%, -50%) scale(1) rotate(360deg); }

  #siteFooter {
    position: fixed;
    bottom: 10px;
    left: 0; right: 0;
    text-align: center;
    font-size: 12px;
    color: #666;
    z-index: 997;
  }
  #siteFooter a {
    color: #999;
    text-decoration: none;
  }
  #siteFooter a:hover {
    color: #ccc;
    text-decoration: underline;
  }

  #noticeOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
  }
  #noticeOverlay.show { display: flex; }
  #noticeBox {
    background: #141414;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
  #noticeBox h2 {
    font-size: 18px;
    margin: 0 0 14px;
    color: #fff;
  }
  #noticeBox p {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 10px;
  }
  #noticeButtons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
  }
  #noticeButtons button {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
  }
  #noticeGuideBtn {
    background: #2a2a2a;
    color: #ccc;
  }
  #noticeOkBtn {
    background: #4a7dff;
    color: #fff;
  }

  #tarotOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 20px;
    box-sizing: border-box;
  }
  #tarotOverlay.show { display: flex; }
  #tarotBox {
    background: #141414;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 24px;
    max-width: 640px;
    width: 100%;
    max-height: 88dvh;
    overflow-y: auto;
    box-sizing: border-box;
    text-align: center;
  }
  #tarotTitle { font-size: 19px; color: #fff; margin: 0 0 8px; }
  #tarotInstruction { font-size: 14px; color: #aaa; margin: 0 0 18px; }
  #tarotDeck {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
  }
  #tarotResult {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
  }
  #tarotSlider {
    display: none;
    flex-direction: column;
    align-items: center;
  }
  #tarotSlider.show { display: flex; }
  #tarotSlideNav {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  #tarotSlideNav button {
    background: #2a2a2a;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 16px;
    cursor: pointer;
  }
  #tarotSlideNav button:disabled {
    opacity: 0.3;
    cursor: default;
  }
  #tarotSlideIndicator {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
  }
  .tarotCardBack, .tarotCardFront {
    width: 54px;
    height: 90px;
    border-radius: 6px;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.15s ease;
  }
  .tarotCardBack:hover { transform: translateY(-4px); }
  @keyframes tarotPickFly {
    0% { transform: scale(1) rotateY(0deg); opacity: 1; }
    50% { transform: scale(1.15) rotateY(90deg); opacity: 0.7; }
    100% { transform: scale(0.3) rotateY(180deg); opacity: 0; }
  }
  .tarotCardBack.picked {
    animation: tarotPickFly 0.5s ease forwards;
    pointer-events: none;
  }
  @keyframes tarotResultIn {
    0% { opacity: 0; transform: translateY(16px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }
  .tarotResultItem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: center;
    width: 160px;
    flex: 0 0 160px;
    animation: tarotResultIn 0.4s ease forwards;
  }
  .tarotResultItem img { width: 140px; height: 240px; border-radius: 8px; flex-shrink: 0; }
  .tarotResultItem .tarotMeaning { font-size: 13px; color: #ccc; line-height: 1.5; width: 100%; }
  .tarotResultItem .tarotPos { font-size: 12px; color: #888; margin-bottom: 2px; }
  .tarotResultItem .tarotCardName { font-size: 15px; color: #fff; font-weight: 700; margin-bottom: 4px; }
  @keyframes tarotSummaryIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  #tarotSummary {
    animation: tarotSummaryIn 0.5s ease forwards;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #333;
    text-align: left;
    font-size: 13.5px;
    color: #ddd;
    line-height: 1.6;
  }
  #tarotSummary .tarotSummarySection {
    margin-bottom: 12px;
  }
  #tarotSummary .tarotSummarySection b {
    color: #8ab4ff;
  }
  #tarotSummary .tarotSummaryTitle {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
  }
  #tarotCloseBtn {
    display: none;
    margin-top: 10px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #4a7dff;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
  }
  #tarotCloseBtn.show { display: inline-block; }

  #particleLayer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
  }
  .particle {
    position: absolute;
    font-size: 32px;
    will-change: transform, opacity;
  }
  @keyframes riseUp {
    0% { transform: translateY(0) translateX(0); opacity: 1; }
    100% { transform: translateY(-115vh) translateX(var(--drift, 0px)); opacity: 0; }
  }
  @keyframes fallDown {
    0% { transform: translateY(-10vh); opacity: 1; }
    100% { transform: translateY(115vh); opacity: 0; }
  }
  @keyframes burstOut {
    0% { transform: translate(0, 0) scale(0.6) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rot)); opacity: 0; }
  }
  @keyframes bubbleUp {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(-105vh) translateX(var(--drift, 0px)) scale(1.15); opacity: 0; }
  }