@font-face { font-family: 'Fredoka'; font-weight: 400; src: url('fonts/fredoka-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 500; src: url('fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; src: url('fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; src: url('fonts/fredoka-latin-700-normal.woff2') format('woff2'); }

:root {
  --purple: #9a49aa;
  --purple-dark: #7a3589;
  --violet: #7b2ff7;
  --orange: #f5a01a;
  --orange-d: #c87f0c;
  --blue: #3a7bfd;
  --blue-d: #2a5ec9;
  --green: #00c46a;
  --green-d: #009a52;
  --red: #f6412d;
  --red-d: #c42d1d;
  --gold: #ffc61a;
  --gold-d: #d9a400;
  --teal: #4bc2ce;
  --bg: #15121f;
  --card: #231e35;
  --ink: #e9e7f7;
  --shadow: inset 0 -0.35vh 0 rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  color: var(--ink);
  user-select: none;
  background: #15121f;
}

button { font-family: inherit; cursor: pointer; border: none; }
button:disabled { cursor: default; }
.hidden { display: none !important; }

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; animation: screenIn 0.35s ease; }
@keyframes screenIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }

/* ---------- generic buttons ---------- */
.btn {
  color: #fff;
  font-weight: 600;
  border-radius: 1vh;
  padding: 1.6vh 3.2vh;
  font-size: 2.6vh;
  box-shadow: inset 0 -0.6vh 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -0.2vh 0 rgba(0, 0, 0, 0.22); }
.btn-big { font-size: 3vh; padding: 2vh 4.5vh; }
.btn-green { background: var(--green); }
.btn-blue { background: var(--blue); }
.btn-gold { background: var(--gold); color: #5a3e00; }

/* ============ HOME ============ */
#home {
  background:
    radial-gradient(circle at 20% 15%, #5a2bb0 0, transparent 40%),
    radial-gradient(circle at 85% 85%, #8a2670 0, transparent 45%),
    linear-gradient(135deg, #1c1033, #3a1a5c);
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bg-shapes span {
  position: absolute;
  display: block;
  border-radius: 22%;
  opacity: 0.18;
  animation: floaty 14s ease-in-out infinite;
}
.bg-shapes span:nth-child(1) { width: 14vh; height: 14vh; left: 6%;  top: 12%; background: var(--orange); }
.bg-shapes span:nth-child(2) { width: 9vh;  height: 9vh;  left: 82%; top: 10%; background: var(--teal); border-radius: 50%; animation-delay: -3s; }
.bg-shapes span:nth-child(3) { width: 18vh; height: 18vh; left: 75%; top: 62%; background: var(--green); animation-delay: -6s; }
.bg-shapes span:nth-child(4) { width: 11vh; height: 11vh; left: 12%; top: 72%; background: var(--red); border-radius: 50%; animation-delay: -2s; }
.bg-shapes span:nth-child(5) { width: 7vh;  height: 7vh;  left: 45%; top: 6%;  background: var(--gold); animation-delay: -8s; }
.bg-shapes span:nth-child(6) { width: 8vh;  height: 8vh;  left: 50%; top: 86%; background: var(--blue); border-radius: 50%; animation-delay: -5s; }
.bg-shapes span:nth-child(7) { width: 6vh;  height: 6vh;  left: 28%; top: 40%; background: #fff; animation-delay: -10s; }
.bg-shapes span:nth-child(8) { width: 10vh; height: 10vh; left: 90%; top: 40%; background: var(--orange); animation-delay: -12s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4vh) rotate(25deg); }
}

.home-top { position: absolute; top: 2vh; right: 2vh; display: flex; gap: 1vh; z-index: 2; }
.icon-btn {
  width: 5.5vh; height: 5.5vh;
  border-radius: 1vh;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 2.6vh;
  font-weight: 600;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.3); }

.home-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.6vh;
  width: min(90vw, 95vh);
}
.logo {
  font-size: 13vh;
  font-weight: 700;
  letter-spacing: -0.2vh;
  line-height: 1;
  text-shadow: 0 1vh 0 rgba(0, 0, 0, 0.18);
  animation: logoIn 0.7s cubic-bezier(.2, 1.6, .4, 1);
}
.logo .bolt { display: inline-block; color: var(--gold); margin-right: 1vh; animation: zap 2.4s ease-in-out infinite; }
.logo .dot { color: var(--gold); }
@keyframes logoIn { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zap {
  0%, 85%, 100% { transform: rotate(0) scale(1); }
  90% { transform: rotate(-12deg) scale(1.15); }
  95% { transform: rotate(10deg) scale(1.1); }
}
.tagline { font-size: 3vh; font-weight: 500; opacity: 0.92; }

.drop-zone {
  width: 100%;
  padding: 5vh 3vh;
  border-radius: 2.4vh;
  border: 0.5vh dashed rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.drop-zone:hover, .drop-zone.drag { background: rgba(255, 255, 255, 0.24); transform: scale(1.015); }
.drop-icon { font-size: 7vh; }
.drop-title { font-size: 3.6vh; font-weight: 600; }
.drop-sub { font-size: 2.3vh; opacity: 0.85; }

.load-error {
  width: 100%;
  background: var(--red);
  border-radius: 1.4vh;
  padding: 1.6vh 2vh;
  font-size: 2.2vh;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.set-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 2vh;
  background: var(--card);
  color: var(--ink);
  border-radius: 2vh;
  padding: 2.2vh 2.4vh 2.2vh 3vh;
  box-shadow: 0 0.8vh 0 rgba(0, 0, 0, 0.18);
  animation: pop 0.4s cubic-bezier(.2, 1.6, .4, 1);
}
.set-info { flex: 1; min-width: 0; }
.set-title { font-size: 3.4vh; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-meta { font-size: 2.2vh; color: #9a96b8; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

.link-btn {
  background: none;
  color: #fff;
  font-size: 2.3vh;
  font-weight: 500;
  text-decoration: underline;
  opacity: 0.85;
}
.link-btn:hover { opacity: 1; }

/* ============ GAME ============ */
#game { background: var(--bg); }

.topbar {
  height: 7vh;
  flex-shrink: 0;
  background: #4a2468;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2vh;
  font-weight: 700;
  font-size: 2.6vh;
  letter-spacing: 0.05vh;
  box-shadow: 0 0.4vh 0 rgba(0, 0, 0, 0.12);
  transition: background 0.3s;
}
.topbar.redeem { background: linear-gradient(90deg, #e09a00, var(--gold)); color: #4d3500; }
.topbar-left { display: flex; align-items: center; gap: 1.6vh; min-width: 0; }
.topbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-btn {
  width: 4.6vh; height: 4.6vh;
  border-radius: 0.8vh;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  font-size: 2.2vh;
  font-weight: 700;
}
.topbar-btn:hover { background: rgba(255, 255, 255, 0.35); }
.topbar-right { white-space: nowrap; text-transform: uppercase; }

.progress { height: 0.9vh; background: rgba(255, 255, 255, 0.08); flex-shrink: 0; }
.progress-fill { height: 100%; width: 0; background: var(--teal); transition: width 0.4s ease; }

.stage {
  background: var(--bg);
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.6vh 1.4vh 1.4vh;
  gap: 1.6vh;
  min-height: 0;
}

.question-row {
  flex: 1.25;
  display: flex;
  gap: 3vh;
  padding: 0 3vh;
  min-height: 0;
}

.card {
  background: var(--card);
  border-radius: 1vh;
  box-shadow: 0 0.5vh 0 rgba(0, 0, 0, 0.45);
}

.image-card {
  flex: 0 0 auto;
  aspect-ratio: 1.2;
  max-width: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2vh;
}
.image-card img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0.6vh; }

.question-card {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 4vh;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
.question-text {
  font-size: 5.6vh;
  line-height: 1.25;
  font-weight: 400;
  color: #f3f1ff;
  overflow-wrap: anywhere;
}
.question-text.med { font-size: 4.4vh; }
.question-text.long { font-size: 3.5vh; }
.question-text.xlong { font-size: 2.8vh; }
.question-card.anim { animation: pop 0.35s cubic-bezier(.2, 1.5, .4, 1); }

.redemption-tag {
  position: absolute;
  top: 1.4vh;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #5a3e00;
  font-weight: 700;
  font-size: 2vh;
  padding: 0.5vh 1.6vh;
  border-radius: 99px;
  box-shadow: var(--shadow);
}
.question-card.redeem { box-shadow: 0 0 0 0.6vh var(--gold), 0 0.5vh 0 rgba(0, 0, 0, 0.1); }

.side {
  flex: 0 0 18vh;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
}
.stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6vh;
  padding: 1.6vh;
}
.streak-box {
  width: 8vh;
  height: 8vh;
  border-radius: 0.6vh;
  background: var(--teal);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -0.6vh 0 rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.streak-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.18) 50%);
}
.streak-num { position: relative; color: #fff; font-weight: 700; font-size: 3.6vh; text-shadow: 0 0.3vh 0 rgba(0,0,0,.2); }
.streak-box.hot { background: var(--orange); }
.streak-box.fire { background: var(--red); }
.streak-box.bump { animation: bump 0.35s ease; }
@keyframes bump { 50% { transform: scale(1.2) rotate(-6deg); } }
.score { font-size: 4.6vh; font-weight: 700; color: #fff; line-height: 1; }
.score-label { font-size: 1.8vh; color: #8a86a8; font-weight: 500; text-transform: uppercase; letter-spacing: 0.2vh; }

.next-btn {
  flex: 0 0 7vh;
  font-size: 3vh;
  font-weight: 700;
  color: #e9e7f7;
  transition: transform 0.1s, background 0.15s;
}
.next-btn:disabled { color: #5a5675; }
.next-btn:not(:disabled) {
  background: #4a2468;
  color: #fff;
  animation: nudge 1.4s ease-in-out infinite;
}
.next-btn:not(:disabled):hover { filter: brightness(1.1); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: scale(1.05); } }

/* feedback strip */
.feedback {
  display: flex;
  align-items: center;
  gap: 2vh;
  margin: 0 3vh;
  padding: 1.6vh 2.4vh;
  border-radius: 1vh;
  color: #fff;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
.feedback.good { background: var(--green); }
.feedback.bad { background: var(--red); }
.feedback-icon { font-size: 5vh; font-weight: 700; line-height: 1; }
.feedback-title { font-size: 2.8vh; font-weight: 700; }
.feedback-text { font-size: 2.4vh; font-weight: 500; opacity: 0.96; }
@keyframes slideIn { from { transform: translateY(1.5vh); opacity: 0; } to { transform: none; opacity: 1; } }

/* answers */
.answers {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 0.7vh;
  min-height: 0;
}
.answer {
  position: relative;
  color: #fff;
  font-size: 3.4vh;
  font-weight: 500;
  border-radius: 0.6vh;
  padding: 1vh 3vh;
  box-shadow: inset 0 -0.7vh 0 rgba(0, 0, 0, 0.2);
  text-shadow: 0 0.2vh 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.1s, filter 0.2s, opacity 0.25s;
  overflow-wrap: anywhere;
  animation: answerIn 0.35s cubic-bezier(.2, 1.5, .4, 1) backwards;
}
.answer.small { font-size: 2.5vh; }
.answer:nth-child(1) { animation-delay: 0.03s; }
.answer:nth-child(2) { animation-delay: 0.08s; }
.answer:nth-child(3) { animation-delay: 0.13s; }
.answer:nth-child(4) { animation-delay: 0.18s; }
@keyframes answerIn { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.answer.c0 { background: var(--orange); }
.answer.c1 { background: var(--blue); }
.answer.c2 { background: var(--green); }
.answer.c3 { background: var(--red); }
.answer:not(:disabled):hover { filter: brightness(1.08); transform: scale(1.012); }
.answer:not(:disabled):active { transform: scale(0.985); }
.answer .key {
  position: absolute;
  top: 1vh;
  left: 1.2vh;
  font-size: 1.7vh;
  font-weight: 600;
  opacity: 0.6;
}
.answer.dim { opacity: 0.3; filter: saturate(0.6); }
.answer.right { background: var(--green); opacity: 1; filter: none; box-shadow: inset 0 -0.7vh 0 rgba(0,0,0,.2), 0 0 0 0.6vh #fff, 0 0 0 1.1vh var(--green); z-index: 1; }
.answer.right::after, .answer.wrong::after {
  position: absolute;
  right: 2vh;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4.6vh;
  font-weight: 700;
}
.answer.right::after { content: '✓'; }
.answer.wrong::after { content: '✗'; }
.answer.wrong { background: var(--red); opacity: 1; filter: none; animation: shake 0.4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-1vh); }
  40%, 80% { transform: translateX(1vh); }
}

/* ============ REDEMPTION INTRO ============ */
#redeemIntro {
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, #3a2c08 0deg 12deg, #2b2006 12deg 24deg);
  align-items: center;
  justify-content: center;
}
.redeem-inner {
  text-align: center;
  background: var(--card);
  border-radius: 3vh;
  padding: 5vh 8vh;
  box-shadow: 0 1.2vh 0 rgba(0, 0, 0, 0.5);
  animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1);
}
.redeem-star { font-size: 13vh; line-height: 1; animation: spin 2.8s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotate(20deg) scale(1.12); } }
.redeem-inner h2 { font-size: 6vh; font-weight: 700; color: #d68f00; margin: 1vh 0; }
.redeem-inner p { font-size: 2.8vh; color: #b9b5d6; margin-bottom: 3.6vh; line-height: 1.35; }

/* ============ RESULTS ============ */
#results {
  background:
    radial-gradient(circle at 80% 10%, #4a238f 0, transparent 40%),
    linear-gradient(135deg, #1c1033, #3a1a5c);
  color: #fff;
  overflow-y: auto;
}
#results.perfect {
  background:
    radial-gradient(circle at 20% 20%, #138a57 0, transparent 40%),
    linear-gradient(135deg, #063d27, #0a6b44 55%, #1b6f78);
}
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

.results-inner {
  width: min(94vw, 150vh);
  margin: 0 auto;
  padding: 6vh 2vh 4vh;
  display: flex;
  flex-direction: column;
  gap: 4vh;
}
.results-head { display: flex; align-items: center; gap: 6vh; justify-content: center; }

.ring { position: relative; width: 34vh; height: 34vh; flex-shrink: 0; animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring-bg { stroke: rgba(255, 255, 255, 0.2); }
.ring-fg {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.2s cubic-bezier(.3, .9, .3, 1);
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-label span { font-size: 8vh; font-weight: 700; line-height: 1; }
.ring-label small { font-size: 2.6vh; font-weight: 500; opacity: 0.85; }

.results-msg h2 { font-size: 7vh; font-weight: 700; line-height: 1.05; text-shadow: 0 0.6vh 0 rgba(0, 0, 0, 0.15); }
.results-msg p { font-size: 2.8vh; font-weight: 500; opacity: 0.92; margin: 1vh 0 2.4vh; }
.stats { display: flex; flex-wrap: wrap; gap: 1.2vh; margin-bottom: 3vh; }
.stat {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 1.2vh;
  padding: 1.2vh 2vh;
  min-width: 13vh;
}
.stat b { display: block; font-size: 3.6vh; font-weight: 700; line-height: 1.1; }
.stat span { font-size: 1.8vh; font-weight: 500; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.15vh; }
.results-actions { display: flex; gap: 1.6vh; }

.review { display: flex; flex-direction: column; gap: 1.4vh; }
.review h3 { font-size: 3.2vh; font-weight: 600; }
.review-item {
  background: var(--card);
  color: var(--ink);
  border-radius: 1.4vh;
  padding: 1.8vh 2.4vh;
  border-left: 1vh solid var(--red);
  box-shadow: 0 0.5vh 0 rgba(0, 0, 0, 0.15);
}
.review-item.redeemed { border-left-color: var(--gold); }
.review-q { font-size: 2.5vh; font-weight: 600; }
.review-a { font-size: 2.2vh; color: #3ddc8a; font-weight: 600; margin-top: 0.4vh; }
.review-e { font-size: 2vh; color: #aaa6c8; margin-top: 0.3vh; }
.review-badge {
  display: inline-block;
  font-size: 1.6vh;
  font-weight: 700;
  padding: 0.2vh 1vh;
  border-radius: 99px;
  margin-left: 1vh;
  vertical-align: middle;
  background: var(--gold);
  color: #5a3e00;
}

.logo { display: flex; align-items: center; justify-content: center; gap: 0; }
.bolt-logo { height: 13vh; width: 13vh; margin-right: 2vh; filter: drop-shadow(0 1vh 0 rgba(0, 0, 0, 0.25)); animation: zap 2.4s ease-in-out infinite; }

/* volume slider */
.vol { display: inline-flex; align-items: center; gap: 1vh; height: 5.5vh; padding: 0 1.6vh; border-radius: 1vh; background: rgba(255, 255, 255, 0.18); color: #fff; }
.vol-ico { font-size: 2.4vh; width: 3vh; text-align: center; }
.vol-slider { -webkit-appearance: none; appearance: none; width: 14vh; height: 1vh; border-radius: 99px; background: rgba(255, 255, 255, 0.3); outline: none; cursor: pointer; }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 2.4vh; height: 2.4vh; border-radius: 50%; background: var(--gold); border: 0.4vh solid #fff; box-shadow: 0 0.3vh 0 rgba(0, 0, 0, 0.25); }
.topbar-right { display: flex; align-items: center; gap: 2vh; }
.topbar-right .vol { height: 4.6vh; background: rgba(255, 255, 255, 0.2); }
.topbar.redeem .vol { color: #4d3500; }

/* explanation tip popup */
.tip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(80vw, 110vh);
  background: #2d2745;
  color: #fff;
  border-radius: 2vh;
  overflow: hidden;
  box-shadow: 0 0 0 0.5vh var(--gold), 0 2vh 6vh rgba(0, 0, 0, 0.6), 0 0 0 200vmax rgba(8, 6, 16, 0.55);
  animation: tipIn 0.35s cubic-bezier(.2, 1.5, .4, 1);
  cursor: pointer;
}
@keyframes tipIn { from { transform: translate(-50%, -46%) scale(0.9); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.tip-head { display: flex; align-items: center; gap: 1.4vh; padding: 3vh 4vh 0; }
.tip-bulb { font-size: 4.6vh; }
.tip-title { font-size: 2.2vh; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 0.2vh; }
.tip-title::before { content: 'Correct answer: '; color: #b9b5d6; }
.tip-text { font-size: 3.8vh; font-weight: 500; line-height: 1.3; padding: 1.6vh 4vh 4vh; }
.tip-bar { height: 1.4vh; background: rgba(255, 255, 255, 0.12); }
.tip-bar-fill { height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
@keyframes tipCountdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ============ AI maker home ============ */
#home { overflow-y: auto; justify-content: flex-start; }
#home .home-inner { margin: auto; padding: 6vh 0 5vh; width: min(92vw, 120vh); }
.logo { font-size: 10vh; }
.bolt-logo { height: 10vh; width: 10vh; }
.tagline { font-size: 3vh; margin-top: -1vh; }

.make-box {
  width: 100%;
  position: relative;
  background: var(--card);
  border-radius: 2.6vh;
  padding: 1.6vh;
  box-shadow: 0 0.9vh 0 rgba(0, 0, 0, 0.35), 0 0 0 0.5vh rgba(255, 255, 255, 0.12);
  animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1);
}
.make-box textarea {
  display: block;
  width: 100%;
  height: 26vh;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 3vh;
  font-weight: 500;
  line-height: 1.35;
  padding: 1.6vh 2vh 8vh;
  user-select: text;
}
.make-box textarea::placeholder { color: #8a86a8; }
.make-box:focus-within { box-shadow: 0 0.9vh 0 rgba(0, 0, 0, 0.35), 0 0 0 0.6vh var(--gold); }
.make-btn { position: absolute; right: 2.2vh; bottom: 2.2vh; }

.history { width: 100%; margin-top: 1vh; }
.history h3 { font-size: 3vh; font-weight: 600; margin-bottom: 1.4vh; opacity: 0.95; }
.history-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vh; }
.history-item {
  display: flex;
  align-items: stretch;
  border-radius: 1.4vh;
  color: #fff;
  box-shadow: inset 0 -0.6vh 0 rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transition: transform 0.1s, filter 0.15s;
}
.history-item:hover { filter: brightness(1.1); transform: translateY(-2px); }
.history-item.c0 { background: var(--orange); }
.history-item.c1 { background: var(--blue); }
.history-item.c2 { background: var(--green); }
.history-item.c3 { background: var(--red); }
.history-main { flex: 1; min-width: 0; background: none; color: inherit; text-align: left; padding: 1.8vh 2.2vh 2.2vh; display: flex; flex-direction: column; gap: 0.2vh; }
.history-title { font-size: 2.8vh; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 2vh; opacity: 0.9; font-weight: 500; }
.history-del { background: rgba(0, 0, 0, 0.12); color: #fff; width: 5vh; font-size: 2vh; font-weight: 700; opacity: 0; transition: opacity 0.15s; }
.history-item:hover .history-del { opacity: 1; }
.history-del:hover { background: rgba(0, 0, 0, 0.35); }

.btn-gray { background: #5a5675; }

/* making overlay */
.making, .modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 6, 22, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.making-card, .modal-card {
  background: var(--card);
  color: #fff;
  border-radius: 3vh;
  padding: 5vh 7vh;
  text-align: center;
  box-shadow: 0 1.2vh 0 rgba(0, 0, 0, 0.5);
  animation: pop 0.4s cubic-bezier(.2, 1.6, .4, 1);
}
.making-bolt { width: 14vh; height: 14vh; animation: boltPulse 0.9s ease-in-out infinite; }
@keyframes boltPulse { 0%, 100% { transform: scale(1) rotate(-6deg); } 50% { transform: scale(1.18) rotate(8deg); } }
.making-title { font-size: 4.6vh; font-weight: 700; margin-top: 1vh; }
.making-sub { font-size: 2.4vh; color: #b9b5d6; margin: 0.6vh 0 2vh; }
.making-card .link-btn { color: #b9b5d6; }

.modal-card { width: min(90vw, 80vh); padding: 4vh 5vh; }
.modal-emoji { font-size: 8vh; line-height: 1; }
.modal-card h2 { font-size: 4vh; font-weight: 700; margin: 1vh 0; }
.modal-card p { font-size: 2.2vh; color: #b9b5d6; line-height: 1.4; margin-bottom: 2.4vh; }
.modal-card input {
  width: 100%;
  font-family: inherit;
  font-size: 2.6vh;
  padding: 1.6vh 2vh;
  border-radius: 1.2vh;
  border: 0.4vh solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  outline: none;
  user-select: text;
}
.modal-card input:focus { border-color: var(--gold); }
.modal-actions { display: flex; gap: 1.4vh; justify-content: center; margin: 2.4vh 0 1.6vh; }
.modal-link { color: #b9b5d6; font-size: 2vh; }
@media (max-width: 800px) { .history-list { grid-template-columns: 1fr; } }
