
/* ---------- Base ---------- */
:root{
  --bg: #f5f5f7;
  --text: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --card-border: #e5e7eb;
  --purple-900: #4a044e;
  --purple-800: #6b0f75;
  --purple-700: #7e22ce;
  --green-600: #16a34a;
  --green-700: #15803d;
  --yellow-500: #eab308;
  --yellow-600: #ca8a04;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-700: #374151;
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.2);
  --shadow-md: 0 6px 12px rgba(0,0,0,0.15);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  transition: background-color .5s ease;
}

/* Baemin Hanna Is Eleven Font */
@font-face {
   font-family: 'bm-hanna';
   /* src: url('https://ndev.writingquests.org/validator/fonts/BMHANNA_11yrs_otf.woff') format('woff'); */
   src: url('/validator/fonts/BMHANNA11yrsoldOTF00.woff2') format('woff2'),
        url('/validator/fonts/BMHANNA11yrsoldOTF00.woff') format('woff');
   font-weight: normal;
   font-style: normal;
}

h1,h2,h3{font-weight:700; font-family:'bm-hanna', 'Inter', system-ui, -apple-system, sans-serif}
.font-serif{font-family:'Merriweather', serif}
.hidden{display:none !important}
.italic{font-style:italic}
.bold{font-weight:700}
.leading-tight{line-height:1.3}

/* ---------- Layout ---------- */
.container{max-width: 80rem; margin: 0 auto; padding: 1rem}
@media(min-width:640px){ .container{ padding: 2rem } }
.logo-link{display:block; width:18rem; margin: 0 0 1rem 0}
.logo-img{width:100%; height:auto}
.page-header{text-align:center; margin-bottom:2rem}
.title{font-size: clamp(2rem, 4vw, 3.25rem); color:#4c1d95; margin:0}
.subtitle{font-size: clamp(1rem, 2.2vw, 1.25rem); color:#374151; margin:.5rem 0 0}
.notice{
  margin: 1rem auto 0;
  padding:.5rem .75rem;
  max-width: 40rem;
  border-radius:.5rem;
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
  font-weight:600;
  font-size:1rem;
}

/* ---------- Card ---------- */
.card{
  background:var(--card);
  padding:1.5rem;
  border-radius:1rem;
  box-shadow: var(--shadow-lg);
  border:1px solid var(--card-border);
}
@media(min-width:640px){ .card{ padding:2rem } }

/* ---------- Grid ---------- */
.grid-2{ display:grid; grid-template-columns: 1fr; gap:1.5rem }
.grid-2.gap-md{ gap:1rem }
@media(min-width:768px){ .grid-2{ grid-template-columns: 1fr 1fr } }

.grid-3-lg{ display:grid; gap:2rem; grid-template-columns: 1fr }
@media(min-width:1024px){ .grid-3-lg{ grid-template-columns: 1fr 1fr 1fr } }

.stack{ display:flex; flex-direction:column }
.gap-lg{ gap:1.5rem }

/* ---------- Forms ---------- */
.form-group{ display:flex; flex-direction:column }
.label{ font-size:1.1rem; font-weight:600; color:#374151 }
.input, .select, .textarea{
  margin-top:.35rem;
  width:100%;
  border:1px solid var(--gray-300);
  border-radius:.75rem;
  padding:.65rem .9rem;
  font-size:1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
  background:#fff;
}
.input:focus, .select:focus, .textarea:focus{
  border-color: var(--purple-700);
  box-shadow: 0 0 0 3px rgba(126,34,206,.2);
}
.help{ margin-top:.35rem; font-size:.8rem; color:#6b7280 }

/* ---------- Footer controls ---------- */
.form-footer{
  margin-top:1rem;
  padding-top:1rem;
  border-top:1px solid var(--gray-200);
  display:flex;
  flex-direction:column;
  gap:1rem;
}
@media(min-width:640px){
  .form-footer{ flex-direction:row; align-items:center; justify-content:space-between }
}
.btn-row{ display:flex; gap:1rem; flex-wrap:wrap }

.btn{
  appearance:none;
  border:0;
  border-radius:.75rem;
  padding:.6rem 1.25rem;
  font-weight:700;
  cursor:pointer;
  box-shadow: var(--shadow-md);
  transition: transform .06s ease, filter .2s ease;
  text-align:center;
}
.btn:active{ transform: translateY(1px) }

.btn-primary{ background:#6d28d9; color:#fff }
.btn-primary:hover{ filter:brightness(0.95) }

.btn-accent{ background:var(--yellow-500); color:#3b0764; font-weight:800 }
.btn-accent:hover{ background:var(--yellow-600) }

.btn-muted{ background:#e5e7eb; color:#374151; font-weight:600 }
.btn-muted:hover{ filter:brightness(0.95) }

.btn-success{ background:var(--green-600); color:#fff }
.btn-success:hover{ background:var(--green-700) }

/* ---------- Results / Badges ---------- */
.results{ margin-top:3rem }
.badges-wrap{ margin-bottom:2rem }
.section-title{ font-size:1.5rem; font-weight:800; color:#4c1d95; text-align:center; margin:0 0 1rem }
.badges{ display:flex; flex-wrap:wrap; gap:1rem; justify-content:center }
.badge{ display:flex; flex-direction:column; align-items:center }
.badge-img{ width:8rem; height:8rem; object-fit:contain; border-radius:.5rem; box-shadow: var(--shadow-md) }
.badge-caption{ font-weight:700; font-size:.9rem; color:#374151; margin-top:.35rem }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

.badge-row:last-child {
  margin-bottom: 0;
}

/* Ensure the badges container allows full width */
.badges {
  display: block;
  width: 100%;
}

/* ---------- Win area ---------- */
.winner-title{
  text-align:center;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color:#4c1d95;
  margin:0 0 1.5rem;
}
.pulse{ animation: pulse 1.5s ease-in-out infinite }
@keyframes pulse{
  0%,100%{ transform: scale(1) } 50%{ transform: scale(1.03) }
}

.certificate-wrap{ display:flex; flex-direction:column; gap:1rem; align-items:center }
.certificate{
  width:100%;
  position:relative;
  padding-top:77.27%; /* aspect ratio holder */
  box-shadow: var(--shadow-lg);
  border:10px solid var(--purple-900);
  background-color:#fdfcfd;
  background-image:url('images/nano2_winners_certificate3.png');
  /* background-image:url('images/NaNoWebCertificate_large.png'); */
  background-size:cover;
  background-position:center top -15%;
  background-repeat:no-repeat;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.certificate-inner{ position:absolute; inset:0 }
.cert-text-tight > * { margin:0 }
.certificate-copy{
  position:absolute;
  top:25%; bottom:20%; left:8%; right:22%;
  display:flex; align-items:center; justify-content:center;
}
.cert-name{ font-size:1rem; font-weight:700; color:#4a044e }
.cert-line{ font-size:.85rem; margin-top:.25rem; color:#1f2937 }
.cert-project{ font-size:1rem; font-weight:700; color:#4a044e; margin-top:.25rem }
.cert-date{ font-size:.85rem; margin-top:.35rem; color:#4b5563 }

.badge-col{ display:flex; flex-direction:column; gap:1rem; align-items:center }

/* =====================================================
   REPLACE the .winner-badge styles in styles2.css 
   (around line 178-192) with these:
   ===================================================== */

.winner-badge {
  width: 20rem;
  height: 20rem;
  max-width: 100%;
  position: relative;
  border-radius: 9999px;
  overflow: hidden;
}

.winner-badge-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.winner-badge-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 7.2rem; /* Push text down to proper position */
  text-align: center;
  color: #fff;
}

.badge-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-year {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.25rem 0 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Progress badge style (unused by default but kept) */
.progress-badge{
  background: linear-gradient(145deg, #a16207, #ca8a04);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Background win color */
/* .win-bg{ background-color:#f3e8ff } */

.win-frame {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in;
  width: 300px;
  height: 300px;
}

.win-frame:not(.hidden) {
  opacity: 1; /* Set to 1 since images are already 50% transparent */
}

.win-frame-top-left {
  top: 0;
  left: 0;
  /* background: url('images/border-upper-left.png') no-repeat; */
  background-size: contain;
}

.win-frame-top-right {
  top: 0;
  right: 0;
  background: url('images/border-upper-right.png') no-repeat;
  background-size: contain;
}

.win-frame-bottom-left {
  bottom: 0;
  left: 0;
  background: url('images/border-lower-left.png') no-repeat;
  background-size: contain;
}

.win-frame-bottom-right {
  bottom: 0;
  right: 0;
  background: url('images/border-lower-right.png') no-repeat;
  background-size: contain;
}

/* Confetti canvas */
.confetti-canvas{
  position:fixed; top:0; left:0; width:100%; height:100%;
  pointer-events:none; z-index:50;
}

/* Misc */
.fullwidth-img{ width:100%; height:auto; margin-top:2rem }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 0;
  background: transparent; /* Make footer background transparent initially */
  color: #fff;
  position: relative;
}

.footer-decoration {
  width: 100%;
  display: block;
  margin: 0;
  vertical-align: bottom;
  background: #f5f5f7; /* Light gray background behind the SVG - same as body */
}

.footer-content {
  background: #2d5559; /* Teal background for the actual content */
  padding: 2rem 1rem 1.5rem;
  max-width: 100%;
  margin: 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
}

.footer-logo img {
  width: 12rem;
  height: auto;
}

.footer-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-menu {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.footer-column li {
  margin: 0.5rem 0;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.5rem;
}

.btn-outline {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.footer-copyright {
  opacity: 0.7;
  font-style: italic;
  font-size: 0.85rem;
  margin: 1.5rem 0;
  text-align: center;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  display: block;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-socials a:hover {
  opacity: 1;
}

.footer-socials img {
  width: 2rem;
  height: 2rem;
}

/* =====================================================
   ADD this CSS for the button decorations
   ===================================================== */

.winner-badge-row {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.winner-badge-row .badge-col {
  align-items: center;
}

/* Ensure download link buttons match the button style */
a.btn {
  display: inline-block;
  text-decoration: none !important;
}

a.btn:hover {
  text-decoration: none !important;
}
