/* ===========================================================================
   EG-ID "Nominate a Website" contest — shared styles
   Used by the homepage overlay (index.html) and the standalone /contest-entry page.
   Prefixes: .nominate-* (shell/overlay), .n* (form), .ngame-* (word-game gate)
   =========================================================================== */

/* ---- Floating reopen button (overlay mode only) ---- */
.nominate-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 2500;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border: none; border-radius: 50px; cursor: pointer;
  font-family: 'Orbitron', monospace; font-weight: 700; font-size: 0.85rem;
  letter-spacing: 1px; color: #0a0a14;
  background: linear-gradient(135deg, #06b6d4, #ffd700);
  box-shadow: 0 8px 30px rgba(6,182,212,0.45);
  opacity: 0; transform: translateY(30px); pointer-events: none;
  transition: opacity .5s ease, transform .5s ease, box-shadow .3s ease;
}
.nominate-fab.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.nominate-fab:hover { box-shadow: 0 10px 40px rgba(255,215,0,0.55); transform: translateY(-3px); }
.nominate-fab i { font-size: 1.05rem; }
.nominate-fab .pip {
  position: absolute; top: -4px; right: -4px; width: 12px; height: 12px;
  background: #ff5d8f; border-radius: 50%; box-shadow: 0 0 0 0 rgba(255,93,143,.7);
  animation: nfabPulse 2s infinite;
}
@keyframes nfabPulse {
  0% { box-shadow: 0 0 0 0 rgba(255,93,143,.7); }
  70% { box-shadow: 0 0 0 10px rgba(255,93,143,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,93,143,0); }
}

/* ---- Overlay ---- */
.nominate-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(4,6,16,0.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s ease;
}
.nominate-overlay.active { opacity: 1; visibility: visible; }

/* Smoothness: while the overlay is open, stop the homepage's heavy background
   animations (50 particles + three blur(80px) orbs + spinning rings). Compositing a
   backdrop-filter over all of that every frame is what made it feel janky. With them
   hidden the backdrop is static and the modal animates smoothly. */
body.contest-open .particles,
body.contest-open .orb,
body.contest-open .ring,
body.contest-open .pulse,
body.contest-open .loading-bar { display: none !important; }

/* ---- Stage (holds assembly + card); also used inline on the page ---- */
.nominate-stage { position: relative; width: min(580px, 94vw); margin: 0 auto; }

/* Assembly shards */
.nominate-assembly { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 1; transition: opacity .45s ease; }
.nominate-assembly.gone { opacity: 0; }
.nshard {
  position: absolute; inset: 0; border-radius: 24px;
  background: linear-gradient(180deg, rgba(26,26,46,0.98), rgba(10,10,20,0.99));
  box-shadow: inset 0 0 0 1px rgba(6,182,212,0.28), inset 0 0 0 2px rgba(255,215,0,0.05);
  opacity: 0;
  animation: shardIn .7s cubic-bezier(.18,.9,.27,1.3) backwards;
  animation-delay: var(--d, 0ms);
}
@keyframes shardIn {
  from { transform: translate(var(--sx), var(--sy)) rotate(var(--sr)) scale(.35); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: translate(0,0) rotate(0) scale(1); opacity: 1; }
}
.nscan {
  position: absolute; left: 0; right: 0; height: 3px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent, #22d3ee, #ffd700, transparent);
  filter: blur(1px); opacity: 0; border-radius: 4px;
}
.nscan.run { animation: nscan 1.25s ease-in-out forwards; }
@keyframes nscan {
  0% { top: 0; opacity: 0; } 12% { opacity: .9; }
  88% { opacity: .9; } 100% { top: 100%; opacity: 0; }
}
.nspark { position: absolute; width: 7px; height: 7px; border-radius: 50%; z-index: 4; pointer-events: none; }
@keyframes nsparkfly { 0% { transform: translate(-50%,-50%) scale(0); opacity: 1; } 100% { transform: translate(var(--tx),var(--ty)) scale(0); opacity: 0; } }

/* ---- The card ---- */
.nominate-card {
  position: relative; z-index: 5;
  background: linear-gradient(180deg, rgba(26,26,46,0.98), rgba(10,10,20,0.99));
  border: 1px solid rgba(6,182,212,0.5); border-radius: 24px;
  padding: 30px 30px 26px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  opacity: 0; transform: scale(.94) translateY(10px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.18,.9,.27,1.2);
}
.nominate-card.show { opacity: 1; transform: none; }
/* While a full-card overlay (word-game or Official Rules) is up, freeze the card's
   own scroll so the absolutely-positioned overlay always aligns to the visible area. */
.nominate-card.locked { overflow: hidden; }
.nominate-card::-webkit-scrollbar { width: 8px; }
.nominate-card::-webkit-scrollbar-thumb { background: rgba(6,182,212,.4); border-radius: 8px; }

/* On the standalone page there is no overlay; show the card without the scale-in gate */
.contest-page .nominate-card { max-height: none; }
/* On the standalone page the card is full-height (no scroll container), so the Rules /
   word-game panels cover the viewport instead of the card. */
.contest-page .nterms,
.contest-page .ngame { position: fixed; z-index: 5000; }

/* Lives on the stage now (a sibling of the card, above every in-card overlay) so it is
   always visible and clickable regardless of how far the card is scrolled. */
.nominate-close {
  position: absolute; top: 10px; right: 12px; z-index: 20; width: 40px; height: 40px; border: none;
  border-radius: 50%; background: rgba(10,14,26,0.85); color: rgba(255,255,255,.85);
  font-size: 1.5rem; line-height: 1; cursor: pointer; transition: all .3s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.nominate-close:hover { background: rgba(255,99,99,0.3); color: #ff6b6b; transform: rotate(90deg); }

.nominate-eyebrow { font-family:'Orbitron',monospace; font-size:.7rem; letter-spacing:3px; text-transform:uppercase; color:#7fd9e8; }
.nominate-title {
  font-family:'Orbitron',monospace; font-size:1.6rem; font-weight:900; margin:8px 0 6px; line-height:1.15;
  background: linear-gradient(90deg,#06b6d4,#ffd700,#22d3ee); background-size:200% 100%;
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  animation: gradientFlow 4s linear infinite;
}
@keyframes gradientFlow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.nominate-sub { color: rgba(255,255,255,0.72); font-size: .98rem; line-height: 1.5; margin-bottom: 22px; }

/* ---- Type toggle ---- */
.ntype { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.ntype-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px;
  border: 1.5px solid rgba(255,255,255,0.14); border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,0.03); color: #fff; transition: all .25s ease; text-align: center;
}
.ntype-btn i { font-size: 1.4rem; color: #06b6d4; transition: color .25s ease; }
.ntype-btn span { font-family:'Orbitron',monospace; font-weight:700; letter-spacing:1px; font-size:.95rem; }
.ntype-btn small { color: rgba(255,255,255,0.45); font-size: .72rem; }
.ntype-btn:hover { border-color: rgba(6,182,212,0.6); transform: translateY(-2px); }
.ntype-btn.is-active {
  border-color: #06b6d4; background: linear-gradient(135deg, rgba(6,182,212,0.18), rgba(255,215,0,0.08));
  box-shadow: 0 6px 26px rgba(6,182,212,0.3);
}
.ntype-btn.is-active i { color: #ffd700; }

/* ---- Fields ---- */
.nfield { margin-bottom: 14px; }
.nrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nfield label { display:block; font-size:.78rem; letter-spacing:.5px; text-transform:uppercase; color:#7fd9e8; margin-bottom:6px; }
.nfield input, .nfield textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04); color: #fff; font-family:'Rajdhani',sans-serif; font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nfield input:focus, .nfield textarea:focus { outline:none; border-color:#06b6d4; box-shadow:0 0 0 3px rgba(6,182,212,.18); }
.nfield textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.ncount { text-align: right; font-size: .72rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.ncount.warn { color: #ffd700; }

.ndivider { display:flex; align-items:center; gap:12px; margin: 22px 0 16px; }
.ndivider::before, .ndivider::after { content:''; flex:1; height:1px; background:rgba(255,255,255,0.12); }
.ndivider span { font-family:'Orbitron',monospace; font-size:.7rem; letter-spacing:2px; text-transform:uppercase; color:rgba(255,255,255,0.55); white-space:nowrap; }

.nconsent { display:flex; gap:10px; align-items:flex-start; margin:6px 0 4px; cursor:pointer; color:rgba(255,255,255,0.7); font-size:.85rem; line-height:1.45; }
.nconsent input { width:18px; height:18px; margin-top:2px; accent-color:#06b6d4; flex-shrink:0; }
.nconsent em { color:#ffd700; font-style:italic; }
.nconsent-note { color: rgba(255,255,255,0.5); font-size: .78rem; line-height: 1.5; margin: 8px 0 2px; }

.nhp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

.nerror { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: rgba(255,93,93,0.12); border:1px solid rgba(255,93,93,0.4); color:#ffb3b3; font-size:.88rem; }

.nsubmit {
  width: 100%; margin-top: 18px; padding: 16px; border: none; border-radius: 14px; cursor: pointer;
  font-family:'Orbitron',monospace; font-weight:700; letter-spacing:1px; font-size:1rem; color:#0a0a14;
  background: linear-gradient(135deg, #06b6d4, #ffd700); transition: transform .2s ease, box-shadow .3s ease;
}
.nsubmit:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(6,182,212,0.45); }
.nsubmit:disabled { opacity: .7; cursor: default; transform: none; }
.nsubmit-spin i { color: #0a0a14; }

.nterms-link { display:block; width:100%; margin-top:14px; background:none; border:none; cursor:pointer;
  color:#7fd9e8; font-size:.85rem; text-decoration:underline; text-underline-offset:3px; }
.nterms-link:hover { color:#22d3ee; }
.nfine { text-align:center; color:rgba(255,255,255,0.4); font-size:.72rem; margin-top:12px; line-height:1.5; }

/* ---- Official Rules slide-up ---- */
.nterms {
  position: absolute; inset: 0; z-index: 6; border-radius: 24px;
  background: linear-gradient(180deg, rgba(16,18,34,0.99), rgba(8,9,18,1));
  display: flex; flex-direction: column;
  transform: translateY(100%); visibility: hidden;
  transition: transform .45s cubic-bezier(.32,.72,0,1), visibility .45s;
}
.nterms.up { transform: translateY(0); visibility: visible; }
.nterms-head { display:flex; align-items:center; justify-content:space-between; padding:20px 24px; border-bottom:1px solid rgba(255,255,255,0.1); }
.nterms-head h3 { font-family:'Orbitron',monospace; color:#fff; font-size:1.15rem; }
.nterms-close { width:36px; height:36px; border:none; border-radius:50%; background:rgba(255,255,255,0.08); color:#fff; font-size:1.3rem; cursor:pointer; transition:all .25s ease; }
.nterms-close:hover { background:rgba(6,182,212,0.3); transform:rotate(90deg); }
.nterms-body { padding: 20px 24px 28px; overflow-y: auto; color: rgba(255,255,255,0.72); font-size: .84rem; line-height: 1.6; }
.nterms-body h4 { color:#7fd9e8; font-family:'Orbitron',monospace; font-size:.78rem; letter-spacing:1px; text-transform:uppercase; margin:16px 0 6px; }
.nterms-body p { margin-bottom: 10px; }
.nterms-body strong { color:#fff; }

/* =========================================================================
   Word-game "human check" gate
   ========================================================================= */
.ngame {
  position: absolute; inset: 0; z-index: 8; border-radius: 24px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(16,28,52,0.99), rgba(7,9,18,1));
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 28px;
  opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .4s ease;
}
.ngame.active { opacity: 1; visibility: visible; }
.ngame-close {
  position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 1.3rem; cursor: pointer; transition: all .25s ease;
}
.ngame-close:hover { background: rgba(255,99,99,0.3); color: #ff6b6b; transform: rotate(90deg); }
.ngame-inner { width: 100%; max-width: 420px; }
.ngame-eyebrow { font-family:'Orbitron',monospace; font-size:.68rem; letter-spacing:3px; text-transform:uppercase; color:#7fd9e8; }
.ngame-title { font-family:'Orbitron',monospace; font-size:1.4rem; font-weight:900; color:#fff; margin:10px 0 4px; }
.ngame-goal { font-family:'Rajdhani',sans-serif; font-size:1rem; color:rgba(255,255,255,0.7); margin-bottom:6px; }
.ngame-goal b { font-family:'Orbitron',monospace; letter-spacing:6px; color:#ffd700; font-size:1.15rem; padding-left:6px; }
.ngame-hint { color: rgba(255,255,255,0.5); font-size: .82rem; margin-bottom: 22px; }

.ngame-slots {
  display: flex; gap: 12px; justify-content: center; margin: 0 auto 18px;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ntile {
  width: 64px; height: 64px; border-radius: 16px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace; font-weight: 900; font-size: 1.7rem; color: #eaf7fb;
  background: linear-gradient(145deg, rgba(6,182,212,0.18), rgba(255,215,0,0.06));
  border: 1.5px solid rgba(6,182,212,0.5); cursor: grab;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 0 12px rgba(6,182,212,0.12);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ntile.enter { animation: ntileEnter .6s cubic-bezier(.18,.9,.27,1.3) backwards; animation-delay: var(--td, 0ms); }
@keyframes ntileEnter {
  from { transform: translate(var(--ex), var(--ey)) rotate(var(--er)) scale(.3); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: none; opacity: 1; }
}
.ntile.sel { border-color: #ffd700; box-shadow: 0 8px 26px rgba(255,215,0,0.4); transform: translateY(-6px) scale(1.05); }
.ntile.dragging { cursor: grabbing; z-index: 20; border-color: #ffd700; box-shadow: 0 14px 36px rgba(0,0,0,.5); transition: none; }
.ntile.correct { border-color: #00ff88; background: linear-gradient(145deg, rgba(0,255,136,0.25), rgba(6,182,212,0.12)); box-shadow: 0 0 24px rgba(0,255,136,0.5); color: #fff; }

.ngame-msg { min-height: 26px; font-family:'Orbitron',monospace; font-weight:700; letter-spacing:1px; font-size:1rem; }
.ngame-msg.win { color: #00ff88; }
.ngame-msg.win .voila { display:inline-block; animation: voilaPop .6s cubic-bezier(.68,-0.55,.265,1.55); }
@keyframes voilaPop { 0% { transform: scale(0) rotate(-12deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
.ngame-shuffle { margin-top: 12px; background:none; border:none; color:#7fd9e8; font-size:.8rem; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.ngame-shuffle:hover { color:#22d3ee; }

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .nrow2 { grid-template-columns: 1fr; }
  .nominate-card { padding: 24px 20px 22px; }
  .nominate-title { font-size: 1.35rem; }
  .nominate-fab span { display: none; }
  .nominate-fab { padding: 16px; }
  .ntile { width: 56px; height: 56px; font-size: 1.45rem; }
  .ngame-slots { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .nshard, .nscan, .ntile.enter { display: none !important; animation: none !important; }
  .ntile.enter { display: flex !important; }
  .nominate-card { opacity: 1 !important; transform: none !important; transition: none !important; }
  .nominate-title { animation: none; }
}
