:root {
  --bg-top: #4c0f13;
  --bg-bottom: #7d171f;
  --panel: rgba(80, 16, 22, 0.8);
  --panel-strong: rgba(112, 25, 31, 0.92);
  --ink: #fff6e8;
  --muted: #f2d7bc;
  --accent: #f2c25d;
  --accent-strong: #ffda84;
  --accent-deep: #c48a2c;
  --border: rgba(255, 210, 128, 0.22);
  --shadow: 0 24px 60px rgba(20, 5, 6, 0.35);
  --success: #97d48e;
  --danger: #ffb1a3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 199, 110, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(255, 215, 138, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    linear-gradient(45deg, rgba(255, 214, 132, 0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 214, 132, 0.07) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 214, 132, 0.07) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 214, 132, 0.07) 75%);
  background-size: 72px 72px;
  background-position: 0 0, 0 36px, 36px -36px, -36px 0;
  opacity: 0.55;
}

body::after {
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 224, 155, 0.18), transparent 10%),
    radial-gradient(circle at 86% 24%, rgba(255, 224, 155, 0.12), transparent 9%),
    radial-gradient(circle at 18% 82%, rgba(255, 224, 155, 0.12), transparent 8%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
  display: grid;
  gap: 20px;
}

.support-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3;
  border: 1px solid rgba(255, 224, 155, 0.22);
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(108, 20, 25, 0.95), rgba(146, 31, 38, 0.95));
  color: #fff2d5;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(20, 5, 6, 0.22);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.support-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(20, 5, 6, 0.28);
}

.petal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.petal {
  position: absolute;
  top: -18%;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, rgba(255, 213, 121, 0.95), rgba(196, 138, 44, 0.95));
  border: 1px solid rgba(255, 238, 187, 0.3);
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow:
    inset 0 0 0 1px rgba(255, 242, 208, 0.24),
    0 8px 16px rgba(20, 5, 6, 0.22);
  opacity: 0.62;
  animation-name: charm-fall, charm-sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
}

.petal::before {
  content: "福";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(102, 14, 18, 0.84);
  transform: rotate(-45deg);
}

.petal-1 { left: 6%; animation-duration: 18s, 4.6s; animation-delay: -2s, -1s; }
.petal-2 { left: 19%; width: 18px; height: 18px; animation-duration: 22s, 5s; animation-delay: -8s, -2s; }
.petal-3 { left: 33%; width: 24px; height: 24px; animation-duration: 24s, 6s; animation-delay: -4s, -3s; }
.petal-4 { left: 48%; width: 20px; height: 20px; animation-duration: 20s, 4.2s; animation-delay: -10s, -2.5s; }
.petal-5 { left: 61%; animation-duration: 26s, 6.4s; animation-delay: -6s, -1.5s; }
.petal-6 { left: 73%; width: 17px; height: 17px; animation-duration: 23s, 5.8s; animation-delay: -12s, -2.8s; }
.petal-7 { left: 84%; width: 25px; height: 25px; animation-duration: 25s, 6.7s; animation-delay: -5s, -3.4s; }
.petal-8 { left: 93%; width: 16px; height: 16px; animation-duration: 19s, 4.8s; animation-delay: -14s, -2s; }

.hero-card,
.game-card,
.result-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(111, 25, 30, 0.92), rgba(80, 16, 22, 0.9)),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card::before,
.game-card::before,
.result-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 215, 138, 0.2);
  border-radius: 24px;
  pointer-events: none;
}

.hero-card {
  padding: 28px 28px 30px;
}

.hero-card::after {
  content: "汉 语";
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  color: rgba(255, 218, 132, 0.34);
}

.eyebrow,
.prompt-tag,
.result-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 224, 155, 0.12);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 224, 155, 0.18);
}

.eyebrow::before,
.prompt-tag::before,
.result-tag::before {
  content: "◎";
  font-size: 0.7rem;
}

h1 {
  margin: 14px 0 12px;
  font-family: "Kiwi Maru", "Noto Sans KR", serif;
  font-size: clamp(2.4rem, 6vw, 4.3rem);
  font-weight: 500;
  line-height: 1.04;
  color: #fff1d6;
}

.subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.mode-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 214, 132, 0.08);
  border: 1px solid rgba(255, 214, 132, 0.14);
}

.mode-title {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--accent-strong);
}

.mode-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 241, 211, 0.12);
  color: var(--ink);
  border: 1px solid rgba(255, 224, 155, 0.18);
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.mode-button.active {
  background: linear-gradient(135deg, #f2c25d, #e39c2e);
  color: #5e1318;
  box-shadow: 0 14px 24px rgba(24, 8, 8, 0.18);
}

.mode-button:hover {
  transform: translateY(-2px);
}

.status-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.status-box,
.result-stats div,
.review-item {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(123, 31, 37, 0.82), rgba(97, 22, 27, 0.92));
  border: 1px solid rgba(255, 214, 132, 0.16);
  box-shadow: inset 0 -8px 0 rgba(255, 214, 132, 0.08);
}

.status-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.status-box strong,
.result-stats dd {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #fff1d6;
}

.game-card,
.result-card {
  padding: 24px;
}

.question-panel {
  position: relative;
  padding: 26px 24px 24px;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(122, 27, 33, 0.96), rgba(97, 22, 27, 0.98)),
    var(--panel-strong);
  border: 1px solid rgba(255, 214, 132, 0.16);
  box-shadow: inset 0 -10px 0 rgba(255, 214, 132, 0.08);
}

.question-stickers {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 10px;
  font-size: 1.2rem;
  color: rgba(255, 218, 132, 0.72);
  font-family: "Noto Sans SC", sans-serif;
}

.question-panel h2 {
  margin: 16px 0 8px;
  font-family: "Noto Sans SC", "Fredoka", sans-serif;
  font-size: clamp(3rem, 9vw, 5.2rem);
  font-weight: 700;
  line-height: 1.05;
  color: #fff3dc;
}

.prompt-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.choices {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.choice-button {
  padding: 18px 10px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 243, 220, 0.98), rgba(237, 192, 104, 0.95));
  box-shadow: inset 0 -8px 0 rgba(190, 125, 34, 0.32), 0 12px 20px rgba(20, 5, 6, 0.18);
  font-family: "Noto Sans SC", "Fredoka", sans-serif;
  font-size: clamp(1.45rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: #65161b;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.choice-button:hover:not(:disabled),
.choice-button:focus-visible:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: inset 0 -8px 0 rgba(190, 125, 34, 0.4), 0 18px 28px rgba(20, 5, 6, 0.26);
  outline: none;
}

.choice-button.correct {
  background: linear-gradient(180deg, rgba(245, 255, 231, 1), rgba(170, 209, 123, 0.98));
  color: #304919;
}

.choice-button.wrong {
  background: linear-gradient(180deg, rgba(255, 234, 220, 1), rgba(233, 149, 119, 0.96));
  color: #5f231d;
}

.feedback-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feedback {
  margin: 0;
  min-height: 1.6em;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 220, 150, 0.08);
  color: var(--muted);
  font-weight: 700;
  border: 1px solid rgba(255, 214, 132, 0.12);
}

.feedback.success { color: var(--success); }
.feedback.error { color: var(--danger); }

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, #f2c25d, #df9928);
  color: #611418;
}

.secondary-button {
  background: linear-gradient(135deg, #a22b33, #cf4a3a);
  color: #fff7ea;
}

.ghost-button {
  background: rgba(255, 239, 211, 0.1);
  color: var(--ink);
  border: 1px solid rgba(255, 224, 155, 0.16);
}

.result-card h3,
.review-header h4 {
  font-family: "Kiwi Maru", serif;
  color: #fff1d6;
}

.result-card p,
.review-item p {
  color: var(--muted);
  line-height: 1.7;
}

.result-stats {
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-stats dd {
  margin: 8px 0 0;
}

.review-panel {
  margin: 8px 0 20px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(111, 25, 30, 0.86), rgba(83, 17, 22, 0.94));
  border: 1px solid rgba(255, 214, 132, 0.12);
}

.review-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.review-item strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 1.05rem;
  color: #fff1d6;
}

.review-item span {
  font-weight: 800;
  color: var(--accent-strong);
}

.review-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 214, 132, 0.12);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 7, 8, 0.46);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 28px 24px 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(117, 26, 32, 0.98), rgba(84, 18, 23, 0.98));
  border: 1px solid rgba(255, 214, 132, 0.18);
  box-shadow: 0 24px 44px rgba(20, 5, 6, 0.32);
  text-align: center;
}

.modal-card h3 {
  margin: 0 0 12px;
  font-family: "Kiwi Maru", serif;
  font-size: 1.8rem;
  font-weight: 500;
  color: #fff1d6;
}

.modal-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 224, 155, 0.12);
  color: var(--accent-strong);
  font-size: 1.4rem;
  cursor: pointer;
}

.copy-account-button {
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #f2c25d, #df9928);
  color: #611418;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-feedback {
  min-height: 1.5em;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hidden {
  display: none;
}

@keyframes charm-fall {
  0% { transform: translate3d(0, -10vh, 0) rotate(45deg); }
  100% { transform: translate3d(-22px, 120vh, 0) rotate(405deg); }
}

@keyframes charm-sway {
  0%, 100% { margin-left: 0; }
  25% { margin-left: 14px; }
  50% { margin-left: -10px; }
  75% { margin-left: 20px; }
}

@media (max-width: 860px) {
  .status-grid,
  .result-stats,
  .choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 16px, 100%);
    padding: 18px 0 28px;
  }

  .hero-card,
  .game-card,
  .result-card,
  .question-panel {
    padding: 18px;
  }

  .status-grid,
  .result-stats,
  .choices,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .mode-options,
  .feedback-row,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .mode-button,
  .support-button {
    width: 100%;
  }

  .support-button {
    top: 12px;
    right: 12px;
    padding: 10px 14px;
    font-size: 0.88rem;
  }
}
