:root {
  --bg-top: #083a37;
  --bg-bottom: #0f5952;
  --panel: rgba(8, 58, 55, 0.84);
  --panel-strong: rgba(15, 89, 82, 0.92);
  --ink: #f2f8f4;
  --muted: #c7e6df;
  --accent: #e7c36b;
  --accent-strong: #f8d98c;
  --border: rgba(248, 217, 140, 0.2);
  --shadow: 0 24px 60px rgba(4, 25, 23, 0.34);
  --success: #95ddb5;
  --danger: #ffc2b0;
}

* { 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(248, 217, 140, 0.14), transparent 22%),
    radial-gradient(circle at bottom right, rgba(190, 238, 227, 0.1), 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(248, 217, 140, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(248, 217, 140, 0.06) 25%, transparent 25%);
  background-size: 76px 76px;
  opacity: 0.5;
}

body::after {
  background:
    radial-gradient(circle at 14% 22%, rgba(248, 217, 140, 0.12), transparent 10%),
    radial-gradient(circle at 86% 24%, rgba(248, 217, 140, 0.08), transparent 9%);
}

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

.adfit-section {
  display: flex;
  justify-content: center;
}

.adfit-card {
  width: 250px;
  min-height: 250px;
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(11, 73, 67, 0.86), rgba(8, 58, 55, 0.94));
  border: 1px solid rgba(248, 217, 140, 0.14);
  box-shadow: 0 16px 30px rgba(4, 25, 23, 0.2);
}

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

.ornament {
  position: absolute;
  top: -16%;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(248, 217, 140, 0.26);
  background: linear-gradient(135deg, rgba(248, 217, 140, 0.96), rgba(194, 147, 69, 0.96));
  transform: rotate(45deg);
  box-shadow: 0 8px 16px rgba(4, 25, 23, 0.22);
  animation-name: ornament-fall, ornament-sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
}

.ornament::before {
  content: "۞";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  color: rgba(10, 63, 58, 0.88);
  transform: rotate(-45deg);
}

.ornament-1 { left: 7%; animation-duration: 18s, 4.2s; animation-delay: -2s, -1s; }
.ornament-2 { left: 21%; width: 18px; height: 18px; animation-duration: 22s, 4.8s; animation-delay: -8s, -2s; }
.ornament-3 { left: 36%; width: 26px; height: 26px; animation-duration: 25s, 6.2s; animation-delay: -5s, -3s; }
.ornament-4 { left: 52%; width: 20px; height: 20px; animation-duration: 20s, 4.1s; animation-delay: -10s, -2.5s; }
.ornament-5 { left: 69%; animation-duration: 24s, 6.4s; animation-delay: -6s, -1.5s; }
.ornament-6 { left: 88%; width: 16px; height: 16px; animation-duration: 19s, 4.8s; animation-delay: -12s, -2s; }

.support-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3;
  border: 1px solid rgba(248, 217, 140, 0.22);
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(11, 77, 71, 0.95), rgba(18, 105, 97, 0.95));
  color: #fff4db;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(4, 25, 23, 0.22);
  cursor: pointer;
}

.hero-card,
.game-card,
.result-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 73, 67, 0.92), rgba(8, 58, 55, 0.9));
  border: 1px solid var(--border);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.hero-card::before,
.game-card::before,
.result-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(248, 217, 140, 0.18);
  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 Naskh Arabic", serif;
  font-size: 1.3rem;
  color: rgba(248, 217, 140, 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(248, 217, 140, 0.12);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(248, 217, 140, 0.18);
}

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: #fff4db;
}

.subtitle,
.prompt-copy,
.result-card p,
.review-item p,
.modal-card p {
  color: var(--muted);
  line-height: 1.8;
}

.mode-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(248, 217, 140, 0.08);
  border: 1px solid rgba(248, 217, 140, 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,
.primary-button,
.secondary-button,
.ghost-button,
.copy-account-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.mode-button {
  background: rgba(238, 252, 248, 0.1);
  color: var(--ink);
  border: 1px solid rgba(248, 217, 140, 0.16);
}

.mode-button.active,
.primary-button,
.copy-account-button {
  background: linear-gradient(135deg, #f8d98c, #d4a94f);
  color: #0a3f3a;
}

.secondary-button {
  background: linear-gradient(135deg, #0e7167, #169285);
  color: #f2fbf8;
}

.ghost-button {
  background: rgba(238, 252, 248, 0.1);
  color: var(--ink);
  border: 1px solid rgba(248, 217, 140, 0.16);
}

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

.result-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-box,
.result-stats div,
.review-item {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 102, 94, 0.82), rgba(10, 74, 68, 0.92));
  border: 1px solid rgba(248, 217, 140, 0.14);
}

.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: #fff4db;
}

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

.question-panel {
  position: relative;
  padding: 26px 24px 24px;
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(18, 108, 99, 0.96), rgba(8, 67, 61, 0.98));
  border: 1px solid rgba(248, 217, 140, 0.16);
}

.question-stickers {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 10px;
  font-size: 1.4rem;
  color: rgba(248, 217, 140, 0.72);
  font-family: "Noto Naskh Arabic", serif;
}

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

.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(247, 239, 212, 0.98), rgba(228, 196, 115, 0.95));
  color: #0b4944;
  font-family: "Noto Naskh Arabic", "Fredoka", serif;
  font-size: clamp(1.45rem, 3.5vw, 2.2rem);
  font-weight: 700;
  cursor: pointer;
}

.choice-button.correct { background: linear-gradient(180deg, rgba(241, 255, 239, 1), rgba(157, 215, 173, 0.98)); }
.choice-button.wrong { background: linear-gradient(180deg, rgba(255, 237, 228, 1), rgba(238, 162, 129, 0.96)); }

.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(248, 217, 140, 0.08);
  color: var(--muted);
  font-weight: 700;
}

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

.review-panel {
  margin: 8px 0 20px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(11, 73, 67, 0.86), rgba(8, 58, 55, 0.94));
  border: 1px solid rgba(248, 217, 140, 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: #fff4db; }
.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(248, 217, 140, 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(4, 25, 23, 0.48);
  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(13, 86, 79, 0.98), rgba(8, 58, 55, 0.98));
  border: 1px solid rgba(248, 217, 140, 0.18);
  box-shadow: 0 24px 44px rgba(4, 25, 23, 0.32);
  text-align: center;
}

.modal-card h3,
.review-header h4,
.result-card h3 {
  margin: 0 0 12px;
  font-family: "Kiwi Maru", serif;
  color: #fff4db;
}

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

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

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

.hidden { display: none; }

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

@keyframes ornament-sway {
  0%, 100% { margin-left: 0; }
  25% { margin-left: 12px; }
  50% { margin-left: -10px; }
  75% { margin-left: 18px; }
}

@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 {
    grid-template-columns: 1fr;
  }

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

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

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