:root {
  --bg: #ffffff;
  --bg2: #fff7fb;
  --bg3: #f4f9ff;
  --text: #2b2348;
  --text2: #5b5479;
  --text3: #8e88a8;
  --border: rgba(120, 90, 200, 0.14);
  --border2: rgba(120, 90, 200, 0.26);

  /* Friendly primary palette */
  --teal: #2BB596;
  --teal2: #36CFA5;
  --teal-bg: #E1FBEF;
  --teal-text: #0E6E55;

  /* Playful accents */
  --pink: #FF7AAE;
  --pink-bg: #FFE6F0;
  --yellow: #FFD93D;
  --yellow-bg: #FFF6CE;
  --blue: #5DC9E2;
  --blue-bg: #DFF5FB;
  --purple: #B084F0;
  --purple-bg: #EFE4FE;
  --coral: #FF8E72;
  --coral-bg: #FFE7DE;

  --amber: #FFB020;
  --amber-bg: #FFF6E0;

  --shadow-sm: 0 2px 4px rgba(120,90,200,0.07), 0 1px 3px rgba(120,90,200,0.06);
  --shadow-md: 0 10px 26px rgba(120,90,200,0.12), 0 3px 8px rgba(120,90,200,0.08);
  --shadow-lg: 0 18px 40px rgba(120,90,200,0.18);

  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --grad-primary: linear-gradient(135deg, #36CFA5 0%, #5DC9E2 50%, #B084F0 100%);
  --grad-warm:    linear-gradient(135deg, #FF7AAE 0%, #FFB36B 50%, #FFD93D 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard GOV', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Noto Sans KR', sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 8% 0%, #FFE6F0 0%, transparent 35%),
    radial-gradient(circle at 95% 12%, #DFF5FB 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, #FFF6CE 0%, transparent 45%),
    linear-gradient(180deg, #FBF7FF 0%, #F4F9FF 100%);
  background-attachment: fixed;
}
button { font-family: inherit; cursor: pointer; }
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 22px;
  line-height: 1;
}

/* ── Layout ── */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
}

/* ── Header ── */
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
#brand { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
#brand-icon {
  width: 62px; height: 62px;
  border-radius: 22px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(176, 132, 240, 0.35);
  animation: float 4s ease-in-out infinite;
  position: relative;
}
#brand-icon::after {
  content: '';
  position: absolute; top: 6px; left: 8px;
  width: 18px; height: 12px;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
  filter: blur(2px);
}
#brand-icon .material-symbols-rounded { font-size: 36px; color: #fff; font-variation-settings: 'FILL' 1, 'wght' 600; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}
#brand-text h1 {
  font-size: 26px; font-weight: 900; letter-spacing: -.6px;
  line-height: 1.1;
}
#brand-text h1 span {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#brand-text p { font-size: 13px; color: var(--text2); margin-top: 4px; font-weight: 500; }

.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  width: 44px; height: 44px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2);
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover { background: var(--purple-bg); color: var(--purple); transform: translateY(-2px) rotate(-4deg); border-color: var(--purple); }
.icon-btn:active { transform: translateY(0) scale(.95); }
.icon-btn-dict {
  background: linear-gradient(135deg, var(--yellow-bg), var(--pink-bg));
  color: var(--pink);
  border-color: rgba(255,122,174,0.3);
}
.icon-btn-dict:hover { background: var(--pink); color: white; border-color: var(--pink); transform: translateY(-2px) rotate(4deg); }
.icon-btn-dict .material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 600; }

.lang-switch {
  display: inline-flex;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.lang-btn {
  padding: 9px 13px;
  font-size: 12px; font-weight: 800;
  border: none; background: transparent;
  color: var(--text2);
  cursor: pointer;
  letter-spacing: .04em;
  transition: all .15s;
}
.lang-btn:hover { background: var(--purple-bg); color: var(--purple); }
.lang-btn.active { background: var(--grad-primary); color: white; }

/* ── Meta row ── */
#meta-row {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.meta-badge {
  font-size: 12px; padding: 6px 13px;
  border-radius: 20px;
  background: var(--teal-bg); color: var(--teal-text);
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 800;
  border: 1.5px solid rgba(43, 181, 150, 0.25);
}
.meta-badge:nth-child(2) { background: var(--blue-bg); color: #176585; border-color: rgba(93,201,226,.3); }
.meta-badge:nth-child(3) { background: var(--purple-bg); color: #6839c4; border-color: rgba(176,132,240,.3); }
.meta-badge .material-symbols-rounded { font-size: 14px; font-variation-settings: 'FILL' 1; }
#streak-badge {
  font-size: 13px; padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg); color: var(--text2);
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto;
  border: 2px solid var(--yellow);
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(255,217,61,.25);
}
#streak-badge .material-symbols-rounded { font-size: 16px; color: var(--yellow); font-variation-settings: 'FILL' 1; }
#streak-badge b { color: var(--pink); font-weight: 900; }
#streak-badge.zero { border-color: var(--border2); box-shadow: none; }
#streak-badge.zero b { color: var(--text3); }
#streak-badge.zero .material-symbols-rounded { color: var(--text3); }

.sel-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 8px;
  border-radius: 12px;
  background: var(--pink); color: white;
  font-size: 12px; font-weight: 900;
  margin-left: 6px;
  box-shadow: 0 3px 8px rgba(255,122,174,.35);
}
.sel-count[hidden] { display: none; }

#hint-btn.is-active {
  background: var(--yellow-bg);
  color: #8a6f00;
  border-color: var(--yellow);
}

.result-actions {
  display: flex; flex-direction: column;
  gap: 10px; align-items: stretch;
}
.link-btn {
  background: transparent; border: none;
  color: var(--text3); font-size: 13px; font-weight: 700;
  padding: 8px 10px; cursor: pointer;
  display: none; align-items: center; justify-content: center; gap: 5px;
  border-radius: 12px;
  transition: color .15s, background .15s;
}
.link-btn:hover { color: var(--purple); background: var(--purple-bg); }
.link-btn .material-symbols-rounded { font-size: 16px; }

.footer-credit {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text2); font-weight: 700;
  text-decoration: none;
  padding: 5px 10px; border-radius: 10px;
  transition: all .15s;
}
.footer-credit span {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer-credit:hover { background: var(--pink-bg); }

/* ── Steps ── */
.steps-wrap {
  margin-bottom: 1.5rem;
  padding: 16px 20px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.steps { display: flex; align-items: center; gap: 8px; }
.sd-item { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sd-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
  flex-shrink: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  border: 2.5px solid transparent;
}
.sd-txt { font-size: 13px; color: var(--text3); font-weight: 700; white-space: nowrap; }
.sd-line { flex: 1; height: 3px; background: var(--border); border-radius: 3px; min-width: 12px; }
.sd-item.on .sd-num {
  background: var(--grad-primary); color: white;
  border-color: white;
  box-shadow: 0 0 0 5px var(--teal-bg), 0 6px 14px rgba(43,181,150,.35);
  animation: bop .6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes bop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.sd-item.on .sd-txt { color: var(--text); font-weight: 800; }
.sd-item.ok .sd-num { background: var(--teal); color: white; border-color: var(--teal); }
.sd-item.ok .sd-txt { color: var(--text2); }

/* ── News card ── */
#news-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
}
#news-card::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 110px; height: 110px;
  background: radial-gradient(circle, var(--yellow-bg), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
#news-card-top { padding: 1.6rem 1.6rem 1.3rem; position: relative; }
.nsrc {
  font-size: 12px; font-weight: 800; color: var(--teal-text);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-bg); padding: 6px 14px; border-radius: 14px;
  border: 1.5px solid rgba(43,181,150,.25);
}
.nsrc .material-symbols-rounded { font-size: 14px; font-variation-settings: 'FILL' 1; }
.ntitle { font-size: 21px; font-weight: 900; line-height: 1.4; margin-bottom: 14px; letter-spacing: -.3px; color: var(--text); }
.nbody { font-size: 15px; color: var(--text2); line-height: 1.85; }
#news-card-foot {
  padding: 1rem 1.6rem;
  border-top: 2px dashed var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.ntags { display: flex; flex-wrap: wrap; gap: 6px; }
.ntag {
  font-size: 12px; padding: 5px 12px;
  border-radius: 20px;
  background: var(--purple-bg); color: var(--purple);
  border: 1.5px solid rgba(176,132,240,.25);
  font-weight: 700;
}
.nlink {
  font-size: 13px; color: var(--pink);
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; text-decoration: none; font-weight: 800;
  padding: 6px 12px; border-radius: 12px;
  background: var(--pink-bg);
  transition: all .15s;
}
.nlink:hover { background: var(--pink); color: white; }
.nlink .material-symbols-rounded { font-size: 15px; }

/* ── Hint ── */
#hint-box {
  font-size: 15px;
  color: #7a5500; background: var(--yellow-bg);
  padding: 16px 20px; margin-bottom: 1.25rem;
  line-height: 1.75;
  border: 2px dashed var(--yellow);
  border-radius: var(--radius);
  display: none;
  position: relative;
}
#hint-box::before {
  content: '💡'; position: absolute; top: -14px; left: 18px;
  background: white; padding: 2px 10px;
  border-radius: 20px; font-size: 16px;
  border: 2px dashed var(--yellow);
}

/* ── Action row ── */
#action-row { display: flex; gap: 10px; margin-bottom: 1.75rem; flex-wrap: wrap; }
.btn {
  padding: 14px 24px; font-size: 15px;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; transition: all .2s cubic-bezier(.34,1.56,.64,1);
  border: 2px solid transparent;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .material-symbols-rounded { font-size: 20px; }
.btn-primary {
  background: var(--grad-primary); color: white;
  box-shadow: 0 8px 20px rgba(43,181,150,.32);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 24px rgba(43,181,150,.4); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn-outline { background: var(--bg); color: var(--text); border-color: var(--border2); box-shadow: var(--shadow-sm); }
.btn-outline:hover:not(:disabled) { background: var(--purple-bg); color: var(--purple); border-color: var(--purple); transform: translateY(-2px); }
.btn-outline-strong {
  width: 100%; padding: 16px;
  background: var(--bg); color: var(--teal-text);
  border: 2.5px solid var(--teal2);
  font-size: 15px; font-weight: 800;
  border-radius: var(--radius);
  display: none; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.btn-outline-strong:hover { background: var(--teal-bg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-cta {
  width: 100%; padding: 18px;
  font-size: 17px; font-weight: 900;
  background: var(--grad-warm);
  color: white; border: none;
  margin-bottom: 1.75rem;
  display: none;
  box-shadow: 0 10px 26px rgba(255,122,174,.4);
  letter-spacing: -.2px;
  border-radius: var(--radius-lg);
}
.btn-cta:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 16px 36px rgba(255,122,174,.5); }
.btn-cta:active { transform: translateY(0) scale(.99); }

/* ── SDG section ── */
#sdg-sec { margin-bottom: 1.5rem; }
#sdg-sec h2 {
  font-size: 16px; font-weight: 900; color: var(--text);
  margin-bottom: 5px;
  display: flex; align-items: center; gap: 8px;
}
#sdg-sec h2 .material-symbols-rounded {
  font-size: 22px; color: var(--purple);
  font-variation-settings: 'FILL' 1;
}
.sec-help { font-size: 13px; color: var(--text3); margin-bottom: 14px; font-weight: 500; }
#sdg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 9px;
}
.sc {
  padding: 14px 5px;
  border-radius: 16px;
  border: 3px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .15s, opacity .15s, box-shadow .15s;
  opacity: .82;
  position: relative;
  user-select: none;
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
}
.sc:hover { transform: scale(1.08) rotate(-2deg); opacity: 1; box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.sc:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; opacity: 1; }
.sc:active { transform: scale(0.94); }
.sc.sel {
  border-color: rgba(255,255,255,.98);
  opacity: 1; transform: scale(1.08);
  box-shadow: 0 8px 22px rgba(0,0,0,.28), inset 0 0 0 2px rgba(0,0,0,.1);
}
.sc.sel::after {
  content: 'check'; font-family: 'Material Symbols Rounded';
  position: absolute; top: 4px; right: 4px;
  background: white; color: var(--teal);
  width: 22px; height: 22px;
  border-radius: 50%; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  font-variation-settings: 'wght' 800, 'FILL' 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.sc .sn { font-size: 19px; font-weight: 900; color: white; display: block; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sc .sl { font-size: 10px; color: rgba(255,255,255,.98); display: block; line-height: 1.25; margin-top: 3px; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,.15); }

/* ── Life section ── */
#life-sec { display: none; margin-bottom: 1.5rem; }
#life-sec h2 {
  font-size: 16px; font-weight: 900;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
#life-sec h2 .material-symbols-rounded {
  font-size: 22px; color: var(--pink);
  font-variation-settings: 'FILL' 1;
}
#life-input {
  width: 100%; padding: 16px 18px;
  font-size: 15px; line-height: 1.75;
  border: 2.5px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg); color: var(--text);
  resize: vertical;
  font-family: inherit;
  min-height: 100px;
  transition: border-color .15s, box-shadow .15s;
}
#life-input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 5px var(--pink-bg); }
.lp-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lp {
  font-size: 13px; padding: 8px 16px;
  border: 2px solid var(--border2); border-radius: 22px;
  background: var(--bg); cursor: pointer;
  color: var(--text2); font-weight: 700;
  transition: all .15s;
}
.lp:hover { background: var(--pink-bg); color: var(--pink); border-color: var(--pink); transform: translateY(-2px); }

/* ── Result ── */
#res-sec { display: none; }
.rc {
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}
.rc-label {
  font-size: 12px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--purple); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.rc-label::after { content: ''; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.rchips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.rchip {
  font-size: 13px; padding: 7px 14px; border-radius: 22px;
  color: white; font-weight: 800;
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
}
.rchip.miss { opacity: .35; text-decoration: line-through; }
.rtext { font-size: 15px; color: var(--text2); line-height: 1.85; }
.life-box {
  font-size: 15px; color: var(--teal-text); line-height: 1.8;
  background: var(--teal-bg); padding: 18px 20px;
  border: 2px dashed var(--teal);
  border-radius: var(--radius); white-space: pre-line;
}
.bonus-box {
  font-size: 15px; color: #7a5500; line-height: 1.8;
  background: var(--yellow-bg); padding: 18px 20px;
  border: 2px dashed var(--yellow);
  border-radius: var(--radius);
}
.score-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 0 0; border-top: 2px dashed var(--border); margin-top: 16px;
}
.score-ico { font-size: 40px; line-height: 1; animation: bop .8s ease; }
.score-num { font-size: 18px; font-weight: 900; color: var(--text); }
.score-sub { font-size: 13px; color: var(--text2); margin-top: 3px; font-weight: 600; }

/* ── Footer ── */
.site-footer {
  text-align: center; margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 2px dashed var(--border);
  font-size: 13px; color: var(--text3);
}
.site-footer p + p { margin-top: 5px; }
.site-footer a { color: var(--teal); text-decoration: none; font-weight: 800; }
.site-footer a:hover { text-decoration: underline; }
.footer-sub { font-size: 12px; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(60, 40, 110, 0.5); backdrop-filter: blur(8px); }
.modal-panel {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-xl);
  max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 28px 80px rgba(60,40,110,.4);
  animation: panel-in .35s cubic-bezier(.34,1.56,.64,1);
  scrollbar-gutter: stable;
}
.modal-panel::-webkit-scrollbar { width: 8px; }
.modal-panel::-webkit-scrollbar-track { background: transparent; margin: 14px 4px; }
.modal-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.modal-panel::-webkit-scrollbar-thumb:hover { background: var(--purple); }
.modal-panel { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.modal-panel-wide { max-width: 720px; }
@keyframes panel-in {
  0% { transform: scale(.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.5rem .9rem;
  position: sticky; top: 0; background: var(--bg);
  border-bottom: 2px dashed var(--border);
  z-index: 1;
}
.modal-head h3 {
  font-size: 19px; font-weight: 900;
  display: flex; align-items: center; gap: 10px;
}
.modal-head h3 .material-symbols-rounded {
  background: var(--grad-warm);
  color: white;
  padding: 6px;
  border-radius: 12px;
  font-size: 22px;
  font-variation-settings: 'FILL' 1;
}
.modal-body { padding: 1.25rem 1.5rem 1.75rem; }
.howto { padding-left: 0; list-style: none; counter-reset: step; }
.howto li {
  position: relative;
  padding: 16px 16px 16px 60px;
  margin-bottom: 12px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px; line-height: 1.65;
  counter-increment: step;
}
.howto li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 14px;
  width: 32px; height: 32px;
  background: var(--grad-primary); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
  box-shadow: 0 4px 10px rgba(43,181,150,.35);
}
.howto li b { color: var(--pink); font-weight: 800; }
.howto-tip {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--yellow-bg);
  color: #7a5500;
  border: 2px dashed var(--yellow);
  border-radius: var(--radius);
  font-size: 14px; line-height: 1.75;
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 600;
}
.howto-tip .material-symbols-rounded { color: var(--yellow); font-size: 22px; flex-shrink: 0; margin-top: 1px; font-variation-settings: 'FILL' 1; }

/* ── Dictionary modal ── */
#dict-body section { margin-bottom: 1.5rem; }
#dict-body section:last-child { margin-bottom: 0; }
#dict-body h4 {
  font-size: 15px; font-weight: 900; color: var(--text);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
#dict-body h4 .material-symbols-rounded {
  color: var(--teal); font-size: 20px; font-variation-settings: 'FILL' 1;
}
.dict-intro-card {
  background: linear-gradient(135deg, var(--pink-bg) 0%, var(--blue-bg) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.dict-intro-card p {
  font-size: 14.5px; line-height: 1.8; color: var(--text);
  margin-bottom: 10px;
}
.dict-intro-card p:last-of-type { margin-bottom: 14px; }
.dict-intro-card b { color: var(--pink); font-weight: 800; }
.dict-keys {
  display: grid; gap: 8px;
  background: rgba(255,255,255,.7);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1.5px solid white;
}
.dict-key { display: flex; gap: 10px; font-size: 13px; line-height: 1.6; }
.dict-k {
  flex-shrink: 0;
  background: var(--purple); color: white;
  font-weight: 800; font-size: 11px;
  padding: 3px 10px; border-radius: 10px;
  height: fit-content;
  min-width: 60px; text-align: center;
}
.dict-v { color: var(--text2); font-weight: 500; }

.dict-hint {
  font-size: 12.5px; color: var(--text3);
  margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg2);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
}
.dict-hint .material-symbols-rounded { font-size: 15px; color: var(--pink); }
.dict-goals { display: grid; gap: 9px; }
.dict-goal {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.dict-goal[open] {
  border-color: var(--gc);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.dict-goal summary {
  list-style: none;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  font-weight: 800;
  user-select: none;
}
.dict-goal summary::-webkit-details-marker { display: none; }
.dict-goal summary:hover { background: var(--bg2); }
.dict-badge {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 900; font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.dict-gname { flex: 1; font-size: 14.5px; color: var(--text); }
.dict-chev {
  color: var(--text3);
  transition: transform .2s;
  flex-shrink: 0;
}
.dict-goal[open] .dict-chev { transform: rotate(180deg); color: var(--gc); }
.dict-goal-body {
  padding: 4px 16px 16px 62px;
  border-top: 1.5px dashed var(--border);
  margin-top: 4px;
  padding-top: 14px;
}
.dict-gdesc {
  font-size: 14px; line-height: 1.75;
  color: var(--text2);
  margin-bottom: 12px;
}
.dict-tlabel {
  font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--gc);
  margin-bottom: 6px;
}
.dict-targets {
  padding-left: 0;
  list-style: none;
}
.dict-targets li {
  font-size: 13.5px; line-height: 1.7;
  color: var(--text);
  padding: 8px 14px;
  margin-bottom: 5px;
  background: var(--bg2);
  border-radius: 10px;
}

.dict-sources {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.dict-sources ul {
  padding-left: 18px;
  margin-bottom: 12px;
}
.dict-sources li {
  font-size: 12.5px; line-height: 1.7;
  color: var(--text2);
  margin-bottom: 6px;
}
.dict-sources li a { color: var(--teal); font-weight: 700; }
.dict-sources li i { color: var(--text); }
.dict-note {
  font-size: 12px; color: var(--text3);
  line-height: 1.65;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-style: italic;
}

/* ── Mobile: tablet ── */
@media (max-width: 640px) {
  .page { padding: 1rem 1rem 4.5rem; }
  #brand-icon { width: 52px; height: 52px; border-radius: 18px; }
  #brand-icon .material-symbols-rounded { font-size: 30px; }
  #brand-text h1 { font-size: 21px; }
  #brand-text p { font-size: 12px; }
  .ntitle { font-size: 18px; }
  .nbody { font-size: 14px; }
  #news-card-top { padding: 1.3rem 1.3rem 1rem; }
  #news-card-foot { padding: .85rem 1.3rem; }
  .btn-cta { font-size: 16px; padding: 16px; }
  #sdg-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
  .sc { padding: 12px 4px; }
  .sc .sn { font-size: 16px; }
  .sc .sl { font-size: 9.5px; }
  .steps-wrap { padding: 13px 15px; }
  .sd-txt { font-size: 12px; }
  .modal-panel-wide { max-width: 100%; }
  .dict-goal-body { padding-left: 16px; }
}

/* ── Mobile: small phone ── */
@media (max-width: 420px) {
  .page { padding: .85rem .85rem 4rem; }
  #brand-text h1 { font-size: 19px; }
  .sd-txt { display: none; }
  .sd-line { min-width: 20px; }
  #sdg-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .sc { padding: 10px 2px; }
  .sc .sn { font-size: 14px; }
  .sc .sl { font-size: 9px; }
  .meta-badge { font-size: 11px; padding: 5px 10px; }
  #streak-badge { font-size: 12px; }
  .ntitle { font-size: 17px; }
  .nbody { font-size: 13.5px; }
  .btn { padding: 13px 18px; font-size: 14px; }
  .btn-cta { font-size: 15px; }
  .rchip { font-size: 12px; }
  .rtext, .life-box, .bonus-box { font-size: 14px; }
  .score-num { font-size: 16px; }
  .icon-btn { width: 40px; height: 40px; }
  .lang-btn { padding: 8px 11px; }
}

/* ── Compact lang popup (narrow screens) ── */
.lang-popup {
  position: fixed;
  z-index: 200;
  background: var(--bg);
  border-radius: 14px;
  border: 2px solid var(--border2);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-width: 72px;
  animation: panel-in .2s cubic-bezier(.34,1.56,.64,1);
}
.lang-popup.open { display: flex; }
.lang-pop-btn {
  padding: 10px 18px;
  font-size: 12px; font-weight: 800;
  border: none; background: transparent;
  color: var(--text2); font-family: inherit;
  cursor: pointer; letter-spacing: .04em;
  transition: all .15s;
}
.lang-pop-btn:hover { background: var(--purple-bg); color: var(--purple); }
.lang-pop-btn.active { background: var(--grad-primary); color: white; }

@media (max-width: 480px) {
  .lang-switch .lang-btn:not(.active) { display: none; }
  .lang-btn.active { position: relative; padding-right: 22px; }
  .lang-btn.active::after {
    content: 'expand_more';
    font-family: 'Material Symbols Rounded';
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    position: absolute; right: 3px; top: 50%;
    transform: translateY(-50%);
    font-size: 14px; line-height: 1;
    pointer-events: none;
  }
  #brand-text p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Dark mode adjustments (kept gentle) ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2a2440;
    --bg2: #35304d;
    --text: #f5f0ff;
    --text2: #d0c8e8;
    --text3: #998fb8;
    --border: rgba(255,255,255,0.12);
    --border2: rgba(255,255,255,0.22);
    --teal-bg: #173d34;
    --teal-text: #9FE1CB;
    --pink-bg: #4a2638;
    --yellow-bg: #423814;
    --blue-bg: #1f3947;
    --purple-bg: #352952;
    --coral-bg: #4a2e26;
    --amber-bg: #423814;
  }
  body {
    background:
      radial-gradient(circle at 10% 0%, #3a2848 0%, transparent 40%),
      radial-gradient(circle at 90% 10%, #1f3947 0%, transparent 45%),
      linear-gradient(180deg, #1c1830 0%, #221a36 100%);
  }
  #dict-body h4 .material-symbols-rounded { color: var(--teal2); }
}
